LC: 1088. Confusing Number II - spiralgo/algorithms GitHub Wiki
The Essence:
-
if it does
not equalitself when it is rotated 180 degrees, it is aconfusing number. -
If it
equalsitself when it is rotated 180 degrees, it is astrobogrammatic number.
Details:
Therefore:
(Total numbers) - (strobogrammatic numbers) = (confusing numbers)
It means, we can use the code here https://github.com/spiralgo/algorithms/pull/323, and just subtract its output from the total count of all numbers generated using 0, 1, 6, 8, 9.
For the implementation: https://github.com/spiralgo/algorithms/pull/324