Skip to content

Instantly share code, notes, and snippets.

View Alaa-Khattab's full-sized avatar
👩‍💻
Focusing

Alaa Khattab Alaa-Khattab

👩‍💻
Focusing
  • Gaza
View GitHub Profile
### Keybase proof
I hereby claim:
* I am alaa-khattab on github.
* I am alaakhattab (https://keybase.io/alaakhattab) on keybase.
* I have a public key ASCWOLdFX56VTGUi7mjRf5WPhc0CYlVX3LcuZQayKK1kawo
To claim this, I am signing this object:
@Alaa-Khattab
Alaa-Khattab / firstNonRepeatingLetter.js
Created December 9, 2017 18:50
create function returns the first character that is not repeated anywhere in the string. Alaa-Khattab
const firstNonRepeatingLetter = (input)=>{
var inputChar = input.split('');
var result = ""
for(x = 0 ; x < inputChar.length ; x++){
var newChar = input.toLowerCase().split('')
newChar.splice(x,1)
if(!newChar.includes(inputChar[x].toLowerCase())){
result = inputChar[x];
break;
}