An open API service indexing awesome lists of open source software.

https://github.com/luizfelipelopes/lonelyinteger

Lonely Integer (Problem resolved in Hacker Rank)
https://github.com/luizfelipelopes/lonelyinteger

algorithm algorithm-challenges algorithms hackerrank javascript

Last synced: about 1 month ago
JSON representation

Lonely Integer (Problem resolved in Hacker Rank)

Awesome Lists containing this project

README

        

# Loonely Integer (Hacker Rank)

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

### Example

*arr = [4, 9, 95, 93, 57, 4, 57, 93, 9]*

The unique element is **95**.

### Function Description

lonelyinteger has the following parameter(s):

* int a[n]: an array of integers

### Returns

* int: the element that occurs only once

### Constraints
* *1 <= ***n*** < 100*
* It is guaranteed that ***n*** is an odd number and that there is one unique element.
* *0 <= a[i] <= 100, where 0 <= i < n*.