Ruby, 27 24 bytes
->n,m{eval'-~rand(m)'*n}
Attempt This Online!
If we change the order of n, m parameters to m, n then following 23 bytes version work, but only in ruby 2.7 (it does not work ...
posted 4y ago
by radarek
· edited
4y ago
by radarek
Answer