Minify
CodeChefOpen on judge ↗
Alan Turing used character frequency analysis to break the enigma code in World War 2, and so do many modern-day compression algorithms. Given a single line N-character text entry (5 <= N <= 250), encode it as a compressed sequence of 1’s and 0’s using the below compression algorithm. Conduct a character frequency analysis on the string. Arrange each unique character in the input in a hierarchy.
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