Check if a Number is a Duck Number
Given a positive integer n written without leading zeroes, return true when its decimal representation contains at least one zero; otherwise return false. A…
Given a positive integer `n` written without leading zeroes, return `true` when its decimal representation contains at least one zero; otherwise return `false`. A value satisfying this condition is called a duck number.
- `1 ≤ n ≤ 10^9` - `n` is always a positive integer and has no leading zeroes.
Example 1: input n = 102; output true. The decimal representation contains zero.
Example 2: input n = 1000; output true. The decimal representation contains zeroes after its leading digit.
Example 3: input n = 123; output false. None of the digits is zero.
Category: Math. Topic: math. Difficulty: Easy. Patterns: math.