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)
- Host: GitHub
- URL: https://github.com/luizfelipelopes/lonelyinteger
- Owner: luizfelipelopes
- Created: 2024-02-27T03:02:17.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-02-27T03:18:45.000Z (about 1 year ago)
- Last Synced: 2024-11-25T19:43:02.690Z (5 months ago)
- Topics: algorithm, algorithm-challenges, algorithms, hackerrank, javascript
- Language: CSS
- Homepage: https://stackblitz.com/edit/vitejs-vite-irvr5e
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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*.