Post History
J, 10 7 bytes +/>:?#/ Try it online! +/>:?#/ #/ : Inserts dyadic # into an array n m Creates n copies of m ? : Roll from 0..y >: : Increment +/ : S...
Answer
#2: Post edited
# [J](https://jsoftware.com/#/), 10 bytes- ```J
[:+/>:@?@#- ```
[Try it online!](https://tio.run/##y/r/P9pKW9/OysHeQfl/mq0VEs9MIU3BjMvQAEgZGgBpCMMAAA)Executes as `+/ >: ? (x # y)` where we make `x` copies of `y` (`n` and `m`), roll for each copy of `y`, increment across the array since `?` rolls from `0..y`, and then sum reduce.
- # [J](https://jsoftware.com/#/), ~~10~~ 7 bytes
- ```J
- +/>:?#/
- ```
- [Try it online!](https://ato.pxeger.com/run?1=m70wa8GCpaUlaboWy7X17azslfUhvE1ptlbV1QpQMYVKhdpaiMSC7WkKZgpmXGkKhgZABKZBDAOINAA)
- ```
- +/>:?#/
- #/ : Inserts dyadic # into an array n m
- Creates n copies of m
- ? : Roll from 0..y
- >: : Increment
- +/ : Sum reduce
- ```
- -3 bytes thanks to torres.
#1: Initial revision
# [J](https://jsoftware.com/#/), 10 bytes ```J [:+/>:@?@# ``` [Try it online!](https://tio.run/##y/r/P9pKW9/OysHeQfl/mq0VEs9MIU3BjMvQAEgZGgBpCMMAAA) Executes as `+/ >: ? (x # y)` where we make `x` copies of `y` (`n` and `m`), roll for each copy of `y`, increment across the array since `?` rolls from `0..y`, and then sum reduce.