Moved Substring to JS alogrithm
moved permutation to js Algorithm