fork download
  1. a = ['hello', 'goodbye', 'pants', 'baa']
  2. b = ['helio', 'godbye', 'spant', 'aba']
  3.  
  4. x = a.length
  5. y = b.length
  6. z = 0
  7.  
  8. if x == y
  9. while z < x do
  10. if a[z].chars.sort.join == b[z].chars.sort.join
  11. puts 1
  12. else
  13. puts 0
  14. end
  15.  
  16. z += 1
  17. end
  18. end
Success #stdin #stdout 0.02s 7460KB
stdin
Standard input is empty
stdout
0
0
1
1