Sponsored
Use these hints if you're stuck. Try solving on your own first.
It is safe to assume the number of operations isn't more than n
The number is small enough to apply a brute force solution.
Solve with full IDE support and test cases