Given an integer array nums, determine if there exists at least one valid partition of the array.
A partition is considered valid if the entire array can be divided into one or more contiguous subarrays such that every subarray satisfies at least one of the following conditions:
The subarray consists of exactly [x, x]).
The subarray consists of exactly [x, x, x]).
The subarray consists of exactly [x, x + 1, x + 2]).
Return true if nums has at least one valid partition, or false otherwise.
Constraints:
nums.length
nums[i]
Given an integer array nums, determine if there exists at least one valid partition of the array.
A partition is considered valid if the entire array can be divided into one or more contiguous subarrays such that every subarray satisfies at least one of the following conditions:
The subarray consists of exactly [x, x]).
The subarray consists of exactly [x, x, x]).
The subarray consists of exactly [x, x + 1, x + 2]).
Return true if nums has at least one valid partition, or false otherwise.
Constraints:
nums.length
nums[i]