PowerShell, 6966 69 bytes
-3 bytes thanks to mazzy
''+($args|%{"$_"*$i++*!!$_}|% t*y|sort)-eq''+eq(''+$args[0]|% t*y|sort)
Takes input at (Rep, Bronze, Silver, Gold)
Figure I'll take a crack at my own question. Converts the numbers toCharArray
s and sorts them. Appends an empty string so the sorted arrays are converted back to space-separated strings which can then be compared.
We handle 0 medal counts with !!$_
which doubly negates the number, making it go non-zero number-> 0 -> 1
or 0 -> 1 -> 0
which is used to blank the repeat counter.