a wiggle sequence sequence difference successive number strictly alternate positive negative the difference exist positive negative a sequence element sequence nonequal element trivially wiggle sequencesfor example 1 7 4 9 2 5 wiggle sequence difference 6 3 5 7 3 alternate positive negativeIn contrast 1 4 7 2 5 1 7 4 5 5 wiggle sequence the difference positive second difference zeroA subsequence obtain delete element possibly zero original sequence leave remain element original orderGiven integer array num return length long wiggle subsequence num Example 1input num 174925output 6explanation the entire sequence wiggle sequence difference 6 3 5 7 3example 2input num 1175101315105168output 7explanation there subsequence achieve lengthOne 1 17 10 13 10 16 8 difference 16 7 3 3 6 8example 3input num 123456789output 2 Constraints1 numslength 10000 numsi 1000 Follow could solve on time