This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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); |