XOXODAY Hiring Challenge | Off-Campus OA (2024) | Check Whether Two Strings are Almost Equivalent
Question · Posted Jun 2026
Problem Statement You are given two strings word1 and word2 consisting of lowercase English letters. Two strings are considered almost equivalent if the absolute difference in the frequency of every character is at most 3. Return true if the two strings are almost equivalent; otherwise, return false. Example Input word1 = "aaaa" word2 = "bccb" Output false Explanation Frequency of 'a' in word1 is 4, while in word2 it is 0. Difference = 4, which is greater than 3, so ...
The full answer & interview discussion are available to premium members.
Log in Create a free account