Advertisement
Farhanhm

Untitled

Mar 27th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.51 KB | None | 0 0
  1.         static void CrackPassword()
  2.         {
  3.             RecPremutation("","thisIsTheWordIWantToFindAnagamsFor");
  4.         }  
  5.         List<String> xd = new List<string>();
  6.  
  7.  
  8.         static void RecPermutation(string soFar, string input)
  9.         {
  10.             if (string.IsNullOrEmpty(input))
  11.             {
  12.                 xd.Add(soFar);
  13.             }
  14.             else
  15.             {
  16.                 for (int i = 0; i < input.Length; i++)
  17.                 {
  18.                     RecPermutation(soFar + input[i], input.Remove(i,1);
  19.                 }
  20.             }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement