brewersfan1976

is_substitution_cipher.rb

Oct 1st, 2016
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.28 KB | None | 0 0
  1. def isSubstitutionCipher(string1, string2)
  2.     array_1 = Array.new
  3.     array_2 = Array.new
  4.     array_1 = string1.split("")
  5.     array_2 = string2.split("")
  6.    
  7.     if (array_1.uniq).length == (array_2.uniq).length then
  8.        return true
  9.     else
  10.        return false
  11.     end
  12. end
Advertisement
Add Comment
Please, Sign In to add comment