Sponsored
Use these hints if you're stuck. Try solving on your own first.
There is a simple O(n) solution to this problem.
You may check the breaking results of <i>n</i> ranging from 7 to 10 to discover the regularities.
Solve with full IDE support and test cases