Dsa
Bit Manipulation
Easy
The Isolated Signal
In a set of integers, the 'Isolation Score' of a number is defined as the minimum Hamming distance between that number and any other number in the set. Given a list of integers, find the highest Isolation Score among all elements.
Input: A line with N, followed by N integers.
Output: The maximum Isolation Score.
Example:
Input:
3
0 7 255
Explanation:
Dist(0, 7) = popcount(0^7) = popcount(7) = 3
Dist(0, 255) = popcount(255) = 8
Dist(7, 255) = popcount(7^255) = popcount(248) = 5
Scores: 0 is 3, 7 is 3, 255 is 5.
Max score is 5.
Output: 5
Key concepts
bit_manipulationhamming_distance
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