3901. Good Subsequence Queries
You are given an integer array nums of length n and an integer p. A non-empty subsequence of nums is called good if: - Its length is strictly less than n. - The greatest common divisor (GCD) of its elements is exactly p. You are also given a 2D integer array queries of length q, where each queries[i] = [indi, vali] indicates that you should update nums[indi] to vali. After each query, determi
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start