Tap here to switch tabs
Problem
Submissions

Problem: Count Digit Appearances

Count Digit Appearances asks you to examine an array of positive integers and return how many times a specified digit occurs across their decimal representations.

Statement

You are given an array of integers nums and an integer digit.

Return the total number of occurrences of digit across the decimal representations of all elements in nums.

Constraints:

  • 1≤1 \leq nums.length ≤1000\leq 1000

  • 1≤1 \leq nums[i] ≤106\leq 10^6

  • 0≤0 \leq digit ≤9\leq 9

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Count Digit Appearances

Count Digit Appearances asks you to examine an array of positive integers and return how many times a specified digit occurs across their decimal representations.

Statement

You are given an array of integers nums and an integer digit.

Return the total number of occurrences of digit across the decimal representations of all elements in nums.

Constraints:

  • 1≤1 \leq nums.length ≤1000\leq 1000

  • 1≤1 \leq nums[i] ≤106\leq 10^6

  • 0≤0 \leq digit ≤9\leq 9