← All problemsSign in

Sanju and his travel

Sanju is a 19-year-old boy who always travels around the world. One day his uncle Jack plans a trip via road. There are P number of petrol bunks in his way. The units of petrol at bunk i is X[i]. All the P petrol bunks are in circular way. They decided to travel in a Van that contains huge petrol tank supporting unlimited petrol. The cost of petrol to travel from bunk i to the bunk i+1 is Y[i]. Th

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.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start