Question bank › Strings
Dsa Strings Hard

Cryptic Anagrams

You are tasked with determining if two given strings are cryptic anagrams of each other. A cryptic anagram is defined as two strings that have the same characters, with the same frequency, but can be arranged in any order. Your program should read two strings from standard input, and print 'YES' if they are cryptic anagrams, and 'NO' otherwise. Both strings will only contain lowercase letters and will be separated by a newline. Example Input: aabb bbaa Example Output: YES

Key concepts

stringsanagramshashing

Practise this out loud — free

Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.

🎙 Practise this question now
Part of Praxari's verified interview question bank. We show the prompt and concepts to practise with — never a copy-paste solution.