Military Officer
CodeChefOpen on judge ↗
MR. Abhinanadan is an officer in the Indian navy. He regularly trains the soldiers. One day he bought a rope whose length is supposed to be K units, which contains characters on it. 1 unit = 1 character. He asked his soldiers to find such part of the rope whose length is maximum and also contain at least one character whose frequency is greater than or equal to the half the length of the rope.
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