Skip to main content
deleted 54 characters in body
Source Link
Razetime
  • 27.4k
  • 3
  • 29
  • 72

J-uby, 6666 61 bytes

(:group_by.& &group_by+:next)|next|:values|:*&(:zip%(:size|:*)|:*&:sum)|:flatten

Try it online!Try it online!

3 bytes longer than actual rubySurely there is a way to improve this. Yep, mostly because i'm not skilled enough at this yet. surely there+ is a way to improve thisvery useful.

J-uby, 66 bytes

(:group_by.& &:next)|:values|:*&(:zip%(:size|:*)|:*&:sum)|:flatten

Try it online!

3 bytes longer than actual ruby, mostly because i'm not skilled enough at this yet. surely there is a way to improve this.

J-uby, 66 61 bytes

:group_by+:next|:values|:*&(:zip%(:size|:*)|:*&:sum)|:flatten

Try it online!

Surely there is a way to improve this. Yep, + is very useful.

Source Link
Razetime
  • 27.4k
  • 3
  • 29
  • 72

J-uby, 66 bytes

(:group_by.& &:next)|:values|:*&(:zip%(:size|:*)|:*&:sum)|:flatten

Try it online!

3 bytes longer than actual ruby, mostly because i'm not skilled enough at this yet. surely there is a way to improve this.