ATLAN Hiring Challenge | Off-Campus OA (2025) | Using Strings and HashMap

Question · Posted Jun 2026

Problem: Maximum Difference Between Even and Odd Frequency I Given a string s, find the maximum value of: freq[a] - freq[b] where: a has an odd frequency b has an even frequency Example Input: s = "aaaaabbc" Output: 3 Explanation Character frequencies: Character Frequency a 5 (odd) b 2 (even) c 1 (odd) Maximum odd frequency = 5 Minimum even frequency = 2 Result: 5 - 2 = 3

The full answer & interview discussion are available to premium members.

Log in Create a free account