Sponsored
Use these hints if you're stuck. Try solving on your own first.
Once x drops below 0 or goes above 1000, is it possible to continue performing operations on x?
How can you use BFS to find the minimum operations?
Solve with full IDE support and test cases