modified lotto scritpt

using List::Util