Traverse current string , one by one remove every character and recur .
for ( let i = 0 ; i < s . length ; i ++ ) { let t = s ; t = t . substr ( 0 , i ) + t . substr ( i + 1 ) ; st = generate ( st , t ) ; } } return st ; }