Skip to main content
4 of 6
deleted 2 characters in body
Shaggy
  • 43.5k
  • 4
  • 36
  • 94

#Japt, 7 bytes

ËÆD
c ö

Test it here


##Explanation Implicit input of array U.

Ë

Map over the array passing each element through a function where D is the current element.

ÆD

Generate an array of length D and fill it with D.

c

Flatten.

ö

Get a random element.

Shaggy
  • 43.5k
  • 4
  • 36
  • 94