Find the longest subsequence summing to a target when picking nums[i] blocks the next nums[i] % 4 elements.
Unlock detailed company stats for this questionUpgrade
Given an array nums of positive integers and an integer target, return the maximum length of a subsequence whose sum is exactly target. If you choose nums[i], you cannot choose any of the next nums[i] % 4 elements. Return -1 if no valid subsequence exists.
Format · Online assessment.
Community answers
No answers contributed by the community yet.


