HackerRank failure redemption A working solution for a HackerRank question that I couldn't figure out earlier. yarn or npm i yarn|npm test