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
    
  
  
    
  | // Input | |
| // [5, 10, 11, [2, 8], [12, 1, 4], [9, [5,4, 12]], 17] | |
| // Output | |
| // [1, 2, 4, 5, 8,9,10, 11, 12, 17] | |
| function isArray(value) { | |
| return value instanceof Array; | |
| } | |
| function getgetFlatArray2(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
    
  
  
    
  | // [1, 3, 6, 9,10, 2, 5] and [3,1,9,4,17,18,10] | |
| // [1, 2, 3, 6, 9, 10, 17, 18] | |
| //merge | |
| //return one array sorted [] | |
| function getSortedArr(arr) { | |
| var a = []; | |
| for (var i = 0; i < arr.length; i++) { | |
| if (arr[i] > arr[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 isOpeningTag(char) { | |
| return ['{', '[', '('].includes(char) | |
| } | |
| function isClosingTag(char) { | |
| return ['}', ']', ')'].includes(char) | |
| } | |
| function checkScope(str){ | |
| var openingTagsCount = 0; | 
  
    
      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
    
  
  
    
  | const add = function(input1, input2) { | |
| return input1 + input2; | |
| } | |
| const subtract = function(input1, input2) { | |
| return input1 - input2; | |
| } | |
| const multiple = function(input1, input2) { | |
| return input1 * input2; | |
| } | |
| const divide = function(input1, input2) { | 
  
    
      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
    
  
  
    
  | import redis | |
| r = redis.Redis(host='127.0.0.1', port=6379, db=0) | |
| i = 0 | |
| for key in r.scan_iter("*",3): | |
| # delete the key | |
| print(key) | |
| r.expire(key,21600) | |
| i +=1 | |
| if i > 10: | |
| break | 
  
    
      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
    
  
  
    
  | const sample = [1, 6, 4, 10, 27, 15, 120, 25, 222, 30]; | |
| const sampl2 = [1, 6, 4, 10, 27, 15, 20, 25, 22, 30]; | |
| const isEven = integer => integer % 2 === 0; | |
| const findValueFromAlternateSortedArray = (arr, search, prevIndex = 0) => { | |
| const lastIndex = arr.length - 1; | |
| const hasOneValue = arr.length === 1; | |
| const pivotIndex = Math.floor(lastIndex / 2); | |
| const nextPivotIndex = isEven(lastIndex) ? pivotIndex : pivotIndex + 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
    
  
  
    
  | const isWhiteBall = ball => ball === 'W'; | |
| const arrangeBlackWhiteBalls = (whiteBalls, blackBalls) => ball => { | |
| if (isWhiteBall(ball)) whiteBalls.push(ball); | |
| else blackBalls.push(ball); | |
| } | |
| const getArrangedBlackWhiteBalls = ballsArr => { | |
| const ballsRearranged = []; | |
| const whiteBalls = []; | 
  
    
      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
    
  
  
    
  | const sample = [1, 6, 4, 10, 27, 15, 120, 25, 222, 30]; | |
| const sampl2 = [1, 6, 4, 10, 27, 15, 20, 25, 22, 30]; | |
| const isEven = integer => integer % 2 === 0; | |
| const findValueFromAlternateSortedArray = (arr, search, prevIndex = 0) => { | |
| const arrLen = arr.length - 1; | |
| const pivotIndex = Math.floor(arrLen / 2); | |
| const nextPivotIndex = isEven(arrLen) ? pivotIndex : pivotIndex + 1; | |
| const pivotIndexValue = arr[pivotIndex]; | 
  
    
      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 moveElement(array, fromIndex, toIndex) { | |
| var element = array[fromIndex]; | |
| array.splice(fromIndex, 1); | |
| array.splice(toIndex, 0, element); | |
| } | |
| function getTabList(openApplicationsCount, tabKeyPressedCount, openApplicationsList) { | |
| var activeTabApplicationIndex = tabKeyPressedCount - 1; | |
| // var activeApplicationTab = openApplicationsList[activeTabApplicationIndex]; | |
| // openApplicationsList.splice(activeTabApplicationIndex, 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
    
  
  
    
  | <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title></title> | |
| <style type="text/css"> | |
| ul { | |
| list-style-type: none; | |
| } | |
| </style> | |
| </head> |