@DebaratiMajumder Hi DebaratiMajumder. The problem description says "you need to split them into several subsequences, where each subsequences consist of at least 3 consecutive integers". You test case cannot be split into subsequences of consecutive integers (therefore [1,2,5,6,8,9] is an invalid subsequence).

@ManuelP Thank you very much for your help. I find out it is because I thought the first character was a part of input. But in fact it isn't. Thank you for your kind help.