function numberOfAnagrams(S) {
// S.length!/repeat!
var total = factorial(S.length),
repeat = 1,
array = S.split('').sort();
for (var i=1;i<array.length;i++) {
function blackOrWhite(s) { // true: black, false: white
var vertical = s[0].charCodeAt(0) - 'a'.charCodeAt(0) + 1;
var horizon = s[1];
if (vertical % 2 == 1) { // vertical odd
if (horizon % 2 == 0) { // horizon even
return false;
}
return true;
} else { // vertical even
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
NewerOlder