Skip to content

gianfelipe93/lonely-integer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lonely Integer

This challenge involves finding the unique element in an array of integers where all other elements occur twice.

Problem Statement

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.

Function Description:

Complete the getLonelyInteger function to return the lonely integer.

Input Format:

The first line contains a single integer, n, the number of integers in the array. The second line contains n space-separated integers that describe the values in a.

Constraints:

  • It is guaranteed that n is an odd number and that there is one unique element.
  • 0 ≤ a[i] ≤ 100, where 0 ≤ i < n.

Getting Started

  1. Clone the repository:
    npm install
    npm test

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published