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 openHoursRatio(queryTimeRange, openHours) { | |
| let duration = 0; | |
| for (let i = 0; i < openHours.length; i += 1) { | |
| const openHour = openHours[i]; | |
| duration += Math.min(queryTimeRange.end, openHour.end) - Math.max(queryTimeRange.start, openHour.start); | |
| } | |
| if (duration < 0) { | |
| return 0; | |
| } | |
| return duration / (queryTimeRange.end - queryTimeRange.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
| var reverse = function(x) { | |
| let num = Math.abs(x); | |
| let result = 0; | |
| while(num > 0) { | |
| const lastNum = num % 10; | |
| num = Math.floor(num /= 10); | |
| const temp = result * 10 + lastNum; | |
| result = temp; | |
| } |
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 find(arr, k) { | |
| const obj = {}; | |
| let start = 0; | |
| let finish = 0; | |
| let beg = 0; | |
| let end = 0; | |
| for (let i = 0; i < arr.length; i += 1) { | |
| const item = beg = end = arr[i]; | |
| if (item in obj) { |
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 find(arr) { | |
| const maxDepth = arr.length - 1; | |
| const result = []; | |
| function helper(newArray, arrayIndex) { | |
| for (let i = 0; i < arr[arrayIndex].length; i += 1) { | |
| const arrCopy = newArray.slice(0); | |
| arrCopy.push(arr[arrayIndex][i]); | |
| if (arrayIndex === maxDepth) { | |
| result.push(arrCopy); | |
| } else { |
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 find(arr) { | |
| const hStack = []; | |
| const pStack = []; | |
| let maxSize = -Infinity; | |
| let pos; | |
| let tempPos; | |
| function helper() { | |
| const tempHeight = hStack.pop(); | |
| tempPos = pStack.pop(); |
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
| define([ | |
| 'Controllers/PageController', | |
| 'Models/Verification' | |
| ], function ( | |
| PageController, | |
| VerificationModel | |
| ) { | |
| const Verify = PageController.extend({ | |
| controllerType: PageController.TYPES.TRANSITION, |
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 say300 () { | |
| var a = ['авантюриста','артиллериста','афериста','бандуриста','барьериста','беллетриста', | |
| 'буериста','бульдозериста','волюнтариста','гитариста','грейдериста','декабриста', | |
| 'домриста','жанриста','интуриста','кавалериста','каламбуриста','(под)канцеляриста', | |
| 'карикатуриста','карьериста','колориста','контроллериста','лейбориста','литавриста', | |
| 'мануфактуриста','маньериста','мемуариста','гидрометриста','радиометриста', | |
| 'секундометриста','тензометриста','фотометриста','хронометриста','(анти)милитариста', | |
| 'миниатюриста','монтекристо','(электро)моториста','мрамориста','октябриста','панегириста', | |
| 'планериста','пленэриста','прожекториста','прокуриста','пуриста','рапириста','ригориста', | |
| 'семинариста','скрепериста','скутериста','(кино)сценариста','террориста','тракториста', |
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
| var f = function () { | |
| var box = document.querySelector('#box'); | |
| var cubes = box.querySelectorAll('span'); | |
| var el = null; | |
| for(var i = 0, l = cubes.length; i < l; i += 1) { | |
| if (el === null) { | |
| el = cubes[i]; | |
| } else if (convert(el.style.backgroundColor) < convert(cubes[i].style.backgroundColor)) { | |
| c(cubes[i]); |