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
const url = require("url"); | |
// first draft solution | |
const solveFirstTry = async () => { | |
const baseURL = "https://www.letsrevolutionizetesting.com/challenge.json"; | |
let id = null; | |
let isThisTheEnd = false; | |
do { |
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
# Author: Jose Munoz | |
#install homebrew | |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" | |
# install CLI tools | |
brew install jq git zsh | |
# install and setup node/npm | |
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash |
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
const flattenArray = (initialArray, depth = (1/0), result = []) => { | |
if(initialArray == null){ | |
return result; | |
} | |
for(const item of initialArray){ | |
if(depth > 1 && Array.isArray(item)){ | |
flattenArray(item, depth - 1, result); | |
} else { | |
result.push(item); |