Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def areIsomorphic(array1, array2)
- if array1.length != array2.length then
- return false
- end
- output1 = Array.new
- output2 = Array.new
- x = 0
- while (x < array1.length)
- output1[x] = array1[x].length
- x = x + 1
- end
- x = 0
- while (x < array2.length)
- output2[x] = array2[x].length
- x = x + 1
- end
- if output1 != output2 then
- return false
- end
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment