Skip to main content
1 of 2
Galen Ivanov
  • 21.2k
  • 3
  • 24
  • 61

J, 19 bytes

1#.'1'=[":@}.i.@],]

Try it online!

Galen Ivanov
  • 21.2k
  • 3
  • 24
  • 61