PHP Classes

File: js/findLonelyInt.js

Recommend this page to a friend!
  Classes of bamigboye biodun   Logical Functions   js/findLonelyInt.js   Download  
File: js/findLonelyInt.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Logical Functions
General-purpose PHP and JavaScript functions
Author: By
Last change:
Date: 1 year ago
Size: 523 bytes
 

Contents

Class file image Download
const LonelyInteger = (a) => { let result = 0; for (const number of a) { result ^= number; } return result; } /* Author : Boluwaji Akinsefunmi(@Iammastercraft) Problem Statement : You will be given an array of integers. All of the integers except one occur twice. That one is unique in the array. Powered by xOR Bitwise logic Given an array of integers, find and print the unique element. Note that this problem is from hackerrank.com */