Check if a Number is a Buzz Number

Given a positive integer n, return true when n is divisible by 7 or its final decimal digit is 7; otherwise return false. A number satisfying at least one of…

Given a positive integer `n`, return `true` when `n` is divisible by 7 or its final decimal digit is 7; otherwise return `false`. A number satisfying at least one of these conditions is called a buzz number.

- `1 ≤ n ≤ 10^9` - `n` is always a positive integer.

Example 1: input n = 14; output true. 14 is divisible by 7.

Example 2: input n = 27; output true. The final digit is 7.

Example 3: input n = 19; output false. 19 is not divisible by 7 and does not end in 7.

Category: Math. Topic: math. Difficulty: Easy. Patterns: math.