DEV Community

Discussion on: Daily Challenge #184 - Form the Minimum

Collapse
 
hyftar profile image
Simon Landry

Wouldn't rotating the array bring the biggest number at the front?

I think swapping the 1st and 2nd number would be ideal.

Also is having a leading zero really against the rules?

Collapse
 
cipharius profile image
Valts Liepiņš

Yeah, swapping seems to be better, would keep the large digits in the lesser valuable positions.

I interpreted the rules this way, because it didn't seem right to lose a digit in the resulting number. That would be like assuming input set [1,2,0] as equivelent to [1,2].