Nebius Early Talent Program (April 4) | Complementary Pairs |

Question · Posted Apr 2026

Problem Statement: Complementary Pairs The Objective: Find the number of pairs (i,j) in an array of strings such that the concatenation of stringData[i] and stringData[j] can be rearranged to form a palindrome. The Palindrome Property: A string can be rearranged into a palindrome if and only if at most one character in that string has an odd frequency. Example Walkthrough: "abc" and "abcd": Concatenation is "abcabcd". Frequencies: a:2, b:2, c:2, d:1. Result: Only 'd' is odd. It can form "abcdcba". ...

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

Log in Create a free account