Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Think about using modular arithmetic.
if x = nums[i] (mod value), then we can make nums[i] equal to x after some number of operations
How does finding the frequency of (nums[i] mod value) help?