Sponsored
Use these hints if you're stuck. Try solving on your own first.
Build the array arr using the given formula, define target = sum(arr) / n
What is the number of operations needed to convert arr so that all elements equal target ?
Solve with full IDE support and test cases