#3704

Count No-Zero Pairs That Sum to N

hard · 14.3% accepted · 53 likes · top 0%

math · dynamic programming

Description

A no-zero integer is a positive integer that does not contain the digit 0 in its decimal representation.

Given an integer n, count the number of pairs (a, b) where:

- a and b are no-zero integers.

- a + b = n

Return an integer denoting the number of such pairs.

Solution