Persistent Workout
CodeChefOpen on judge ↗
Nikhil made a new year resolution to work out everyday. There are n gyms in his neighborhood all arranged in a straight line at an equal distance. i.e. Gym $1$ is $1$ unit away, Gym $2$ is $2$ units away.... Gym $n$ is $n$ units away. Every Gym has a daily entry fees. You are given the array G containing $G_1$, $G_2$, .... , $G_n$ where $G_i$ is the daily fees of Gym $i$. He plans a sche
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start