Suit Up !
CodeChefOpen on judge ↗
Ted Mosby is offered by Barney a problem in order to prove his friendship. Barney gives Ted a string S of length N and asks him a simple question to tell him the maximum difference between the first and the last index of any character in the string. Specifically, two indices are chosen i,j ( i Input - First line of input contains T , the number of test cases . - Next T lines contains String S O
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