Count the Digit

Write a function count_digit(d, n) that receives a single digit d
(non-negative integer less than 10) and a positive integer n and returns
the number of occurrences of digit d in n.

Observation

All integers are assumed written in the usual base 10.

Problem information

Author: Jordi Delgado &amp; José Luis Balcázar

Generation: 2026-01-25T15:56:51.601Z

© Jutge.org, 2006–2026.
https://jutge.org
