fixed linter errors

pull/969/head
Pranav-Rustagi 2022-10-06 23:55:21 +05:30
parent 6f6ef9d61a
commit 74d100eaf7
1 changed files with 8 additions and 7 deletions

View File

@ -1,10 +1,11 @@
// Problem: Given an array of integers, every element appears twice except for one. Find that single one.
// Problem: Given an array of integers,
// every element appears twice except for one. Find that single one.
// Space Complexity: O(1)
// Time Complexity: O(n)
function singleOccurringElement(arr) {
let result = 0;
for(let el of arr) {
for (const el of arr) {
result ^= el;
}
return result;