← 返回 snowflake 的题目列表Unequal Elements
类型:online_judge
Given an integer array nums, find the longest subsequence where adjacent elements are not equal. Implement a function findMaxLength that takes an integer array nums as a parameter and returns the length of the longest subsequence.
Example Input:
"1, 2, 2, 3, 3, 4"
Example Output:
4
Example
Input
1, 2, 2, 3, 3, 4