Nov. 18, 2023, 11:42 a.m. | Owen Rees

DEV Community dev.to

The Lonely Integer problem is a common coding challenge used to test your ability to count or filter numbers in an array, with the goal of isolating the number which appears only once. On HackerRank, the definition is as follows:


Given an array of integers, where all elements but one occur twice, find the unique element.



Example:
a = [1, 2, 3, 4, 3, 2, 1];

The unique element is 4 …

array bitwise challenge coding definition filter hackerrank integer javascript numbers problem programming test xor

CyberSOC Technical Lead

@ Integrity360 | Sandyford, Dublin, Ireland

Cyber Security Strategy Consultant

@ Capco | New York City

Cyber Security Senior Consultant

@ Capco | Chicago, IL

Sr. Product Manager

@ MixMode | Remote, US

Corporate Intern - Information Security (Year Round)

@ Associated Bank | US WI Remote

Senior Offensive Security Engineer

@ CoStar Group | US-DC Washington, DC