Official algorithmic problem description and constraints.
Rudolf has an array π of π integers, the elements are numbered from 1 to π.
In one operation, he can choose an index π (2β€πβ€πβ1) and assign:
Rudolf can apply this operation any number of times. Any index πcan be used zero or more times.
Can he make all the elements of the array equal to zero using this operation?
Detailed video explanations, mathematical intuition, and clean C++ implementation code.