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
function toLowerCase(obj) { | |
if (!obj) { | |
return; | |
} | |
if (typeof obj !== 'Object' && typeof obj !== 'object') { | |
return; | |
} | |
var keys = Object.keys(obj); | |
var result = {}; | |
keys.map(function(k, v) { |
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 target = 486; | |
const nums = [3, 3, 6, 8, 9, 100]; | |
const op = [['+', (a, b) => a + b], ['-', (a, b) => a - b], ['*', (a, b) => a * b], ['/', (a, b) => a / b]]; | |
let numSolutions = 0; | |
let bestSolution; | |
function solve(nums, solution) { | |
for (let i = 0; i < nums.length; i++) { |