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 solution(N) { | |
| return getRound(N); | |
| } | |
| function getRound(N) { | |
| const tiles = [1, 2]; | |
| for(let i = 2; i <= N; i += 1) { | |
| tiles[i] = tiles[i - 2] + tiles[i - 1]; | |
| } | 
  
    
      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 solution(N) { | |
| return getRound(N); | |
| } | |
| function getRound(N) { | |
| const tiles = [1, 2]; | |
| for(let i = 2; i <= N; i += 1) { | |
| tiles[i] = tiles[i - 2] + tiles[i - 1]; | |
| } | 
  
    
      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 solution(n, s) { | |
| if(n === 1) return [s]; | |
| if(s < n) return [-1]; | |
| const ave = parseInt(s/n); | |
| const r = s % n; | |
| const answer = []; | |
| if(r === 0) { | |
| return new Array(n).fill(ave); | 
  
    
      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 solution(people, limit) { | |
| let num = people.length; | |
| let start = 0; | |
| let end = num - 1; | |
| let pair = 0; | |
| people.sort((a,b) => a-b); | |
| while(start < end) { | |
| const light = people[start]; | 
  
    
      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 solution(n){ | |
| if(n === 1) return 1; | |
| const nArr = Array.from(n.toString(2)); | |
| return nArr.reduce((a,b)=>(+a)+(+b)); | |
| } | 
  
    
      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 solution(n,a,b){ | |
| let answer = 0; | |
| while(a !== b) { | |
| a = Math.ceil(a / 2); | |
| b = Math.ceil(b / 2); | |
| answer += 1; | |
| } | |
  
    
      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 solution(str1, str2) { | |
| const multipleSet1 = makeMultipleSet(str1.toUpperCase()); | |
| const multipleSet2 = makeMultipleSet(str2.toUpperCase()); | |
| const unionAndIntersection = findUnionAndIntersection(multipleSet1, multipleSet2); | |
| return Math.floor((unionAndIntersection[0] / unionAndIntersection[1]) * 65536); | |
| } | |
| function makeMultipleSet(arr) { | 
  
    
      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 solution(name){ | |
| let answer = -1; | |
| let idx = 0; | |
| const newArr = []; | |
| if(/[A]+/.test(name)) { | |
| const match = name.match(/[A]+/g); | |
| let max = 0; | |
| for(let i = 0; i < match.length; i++) { | |
| if(match[i].length > max) { | 
  
    
      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 solution(skill, skill_trees) { | |
| let skillPos = 0; | |
| let answer = 0; | |
| const findWrongSkillTree = (skillTree, skill) => { | |
| for(let el of skill) { | |
| const currSkillIdx = skillTree.indexOf(el); | |
| if(currSkillIdx === -1) skillPos = currSkillIdx; | |
| if(skillPos === -1 && currSkillIdx >= 0) { | 
NewerOlder