Back to problems

Distinct Wall Crossing on Number Line

Algorithm · Scale AI · Hard

You're moving along a limitless number line scattered with invisible walls. The goal is to pass through as many different walls as possible without exhausting your energy budget. You begin at position 0 with an initial energy reserve E. Each turn you can shift one step left or right (from integer n to n+1 or n-1). As you wander, you'll encounter walls; every wall sits at a unique location and has an individual crossing cost. Movement & Crossing Rules Every wall lies at a…

Checking your access…