Skip to content

Instantly share code, notes, and snippets.

View Crashillo's full-sized avatar

Hugoren Martinako Crashillo

View GitHub Profile
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++) {
@orcaman
orcaman / gist:dd40b04e0e42eed841d7
Last active January 26, 2021 10:32
Get a lowercase representation of a JSON object, recursively (JS)
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) {