skeleton for ugly number solution