Problem 3202 · Medium

Find the Maximum Length of Valid Subsequence II

Every neighbouring pair of a valid subsequence has the same sum modulo k; a table keyed by end index and remainder extends chains.

Open the interactive visualisation