Given an integer array nums, return the length of the longest harmonious subsequence of nums.
A subsequence is formed by deleting zero or more elements from nums without changing the relative order of the remaining elements. A subsequence is called harmonious if the difference between its maximum value and minimum value is exactly
If no harmonious subsequence exists, return
Constraints:
nums.length
nums[i]
Given an integer array nums, return the length of the longest harmonious subsequence of nums.
A subsequence is formed by deleting zero or more elements from nums without changing the relative order of the remaining elements. A subsequence is called harmonious if the difference between its maximum value and minimum value is exactly
If no harmonious subsequence exists, return
Constraints:
nums.length
nums[i]