Skip to content

Instantly share code, notes, and snippets.

View Simperfy's full-sized avatar
🛠️
Building Dapps

⧫\_(+<+)_/⧫ Simperfy

🛠️
Building Dapps
View GitHub Profile
function isIsogram(str){
let parsedStr = '';
str = str.toLowerCase().split('');
for (const s of str) {
if (parsedStr.indexOf(s) >= 0) return false;
parsedStr += s;
}
return true;
@Simperfy
Simperfy / maxSubArray.js
Last active March 27, 2021 14:35
Compute max sub array
let best = 0, sum = 0;
const arr = [1, -2, 3, -2, 3];
for (let k = 0; k < arr.length; k++) {
sum = Math.max(arr[k], sum+arr[k]);
best = Math.max(best, sum);
}
console.log(best);