Pani Puri
CodeChefOpen on judge ↗
A Pani Puri shop is conducting a contest: Given a few chaat items’ names and a set of queries where each query is of the form ($l,r$).Take the substring of the chaat item’s name say $s$ ($s[l], s[l+1],...,s[r]$) ]) and if $s[i]\lt s[i-1]$ then one Pani Puri will be added into your account.At the end, you’ll be awarded with the number of Pani Puris you have acquired. By default, if the substring in
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