본문 바로가기
Beakjoon&프로그래머스/파이썬

[백준/파이썬] 6736번 The Idiot of the Year Contest!

by 현장 2024. 10. 17.

-Code

from math import factorial

for _ in range(int(input())):
    a, b = map(int, input().split())

    print(str(factorial(a)).count(str(b)))