repl.it
@jrunning/

ElectricCompassionateLangur

Ruby

No description

fork
loading
Files
  • main.rb
main.rb
1
2
3
4
5
6
7
8
9
10
require "set" # Simulate -rset flag

fn=
->s{d=Set.new
q=0
s.each_char{|c|d^=[q+=1i**(c.ord%11)]}
d.size}

p fn["^>v<^"]
p fn["v>v<^^<v<<^<^><<>^^>>><v>vv^v>v^><><<^>><<<vvv^vvv>v>>v><vv^^<<>vv^^>v^<>>^^<^^>^^v<^>^<vvv^v^v><^<<v<<>><<>v>>^><^>^^<>>>>vv>^<<^<<><vvv<v^>>vvv>v^>>><<v^>^^^^v>>^>^v>v<vv^<>^<<v>vv>><^^<^><vv^^v<v<v^^^>v<^vv^v<><vv^^^>v^>v>vv<<^><v<^v><<v^^v>>v<vv<><^^^v<^v><><<^^<>^>><^^^>vv^<>>>>^<^<<<<>>>v<<v<v<vv><<vv<vv<^v^^^>>vv<>v>><<<v^>vv><v<<<v<<>^vvv^<v^v>^^v^v><<v^>>>v<v<v^>>>v><>>>^<><<<<>vv>v><v>v><^v<>v>>>vv<<>^>^>v<^><^<^vv^><^^>v<^^v>v^v<^^^^vv<>v<>><v^^><>v<<<>v^<v^^><>^<>^<>><>^^<>^v><>>><v<^^>>v>^^^<v"]
ruby 2.5.5p157 (2019-03-15 revision 67260) [x86_64-linux]