Skip to main content
1 of 3
Jonah
  • 33.8k
  • 4
  • 40
  • 94

J, 36 bytes

3=[:(5 12&e.+/@,17={:)[:+/\1+e.&'07'

Try it online!

still golfing

Jonah
  • 33.8k
  • 4
  • 40
  • 94