This file contains 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
findLongestSubstring Solution | |
function findLongestSubstring(str) { | |
let longest = 0; | |
let seen = {}; | |
let start = 0; | |
for (let i = 0; i < str.length; i++) { | |
let char = str[i]; | |
if (seen[char]) { | |
start = Math.max(start, seen[char]); |
This file contains 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 countdown (minutes) { | |
for (let seconds = minutes * 60 ; seconds >= 0; seconds--) { | |
setTimeout(() => tick(seconds), 1000); | |
} | |
function tick (seconds) { | |
let secondsView = ((seconds%60) >= 10) ? seconds%60 : `0${seconds%60}`; | |
console.log(`${Math.floor(seconds/60)||"00"}:${secondsView||"00"}`); | |
} |
This file contains 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 outputValue = document.getElementById('output'); | |
let numbers = document.querySelectorAll('.num-btn'); | |
let decimal = document.getElementById('dec-btn') | |
let operators = document.querySelectorAll('.op-btn'); | |
let equals = document.getElementById('equal-btn'); | |
let clear = document.getElementById('clear'); | |
let inputValue = []; | |
function add(num1, num2) { | |
return num1 + num2; |