Count numbers containing 4 Basic Accuracy: 48.18% Submissions: 2010 Points: 1 Count the numbers between 1 to N containing 4 as a digit. Example 1: Input: N = 9 Output: 1 Explanation: 4 is the only number between 1 to 9 which contains 4 as a digit. Example 2: Input: N = 14 Output: 2 Explanation: 4 and 14 are the only number between 1 to 14 that contains 4 as a digit. Your Task: You don't need to read input or print anything. Your task is to complete the function countNumberswith4() which takes an Integer N as input and returns the answer.
Posts
Showing posts from May, 2021