Needed one clarification regarding second test case. 1 2 1 is the given sequence. As per the question, 1 2 1 and 2 1 both are sub-sequence. As per the condition, in any sub-sequence a[i] < a[i+1]. Then both will not be AP sequence. how come ans is 1. Pls explain where i'm wrong.
↧