← ALL NOTES
Array

3202. Find the Maximum Length of Valid Subsequence II

Given an array nums and a number k. A subsequence is valid if (sub[i]+sub[i+1])%k is the same for all adjacent pairs. Find the length of the longest valid subsequence.

Loading…