← All problemsSign in

Compare those strings

CodeChefRating 1756Open on judge ↗

Chef has two strings $A$ and $B$ consisting of lowercase alphabets, each of length $N$. Help Chef in finding the number of indices $i$ $(1 \leq i \leq N)$ such that $A[i \dots N] \lt B[i \dots N]$. - $S[i \dots N]$ denotes the suffix of string $S$ starting at index $i$, i.e. $S_iS_{i+1}$ $\dots$ $S_{N}$. - String $S \lt$ String $T$ denotes that $S$ is lexicographically smaller than $T$. If two s

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