Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
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 processData(input) { | |
var temp = input.split('\n') | |
var [ N, I ] = temp.shift().split(' ').map( Number ) | |
// generate graph | |
var graph = [] // store in an array of Set [ 0 : [ 0, 1 ], 1 : [ 3, 2 ] ] (to prevent duplicate) | |
var relationalMap = {} // use to remember the map { 0 : 0, 1 : 0, 2 : 1, 3 : 1 } | |
for(let i = 0; i < I;i++) | |
{ |