bugl
bugl
HomeLearnPatternsPathsSearchPremium
HomeLearnPatternsPaths
EasyMath & GeometryLC 263

Ugly Number

An ugly number is a positive integer whose prime factors are limited to 2, 3, and 5. Given an integer n, return true if n is an ugly number.

Hints
  • 1.Think about which data structure fits best
  • 2.Consider the time complexity of your approach
  • 3.Look for patterns in the constraints
LeetCode