Pro Chef And Katana
CodeChefOpen on judge ↗
Now Chef is a pro in handling a katana. So he again decides to play a game with N sticks each having a particular height, his aim is to finish all the sticks he has. Now he does this in a particular way! He selects the largest continuous subsegment of sticks in which every stick has non zero height and then selects a non zero height and then swing the katana in the selected segment and removes the
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