Check if a Number is a Tech Number

Given a positive integer n, return true if n has an even number of decimal digits and the square of the sum of its two equal-length halves equals n. Leading…

Given a positive integer `n`, return `true` if `n` has an even number of decimal digits and the square of the sum of its two equal-length halves equals `n`. Leading zeroes inside the right half are preserved by the split. For example, `2025` becomes `20` and `25`.

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

Example 1: input n = 2025; output true. 20 + 25 = 45, and 45² = 2025.

Example 2: input n = 1234; output false. 12 + 34 = 46, and 46² is not 1234.

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