Problem 172: Investigating numbers with few repeated digits

FCC link

How many 18-digit numbers n (without leading zeros) are there such that no digit occurs more than three times in n?

Test

{{test}}

Console output