Yearly Archive: 2015

find permutations using javascript 0

find permutations using javascript

recPerm(‘abc’, ”); function recPerm(rest, soFar) { var next; var remaining; if (rest == ”) { console.log(soFar); } else { for (var i = 0; i < rest.length; i++) { remaining = rest.substr(0,i) + rest.substr(i+1,rest.length-1);...