1

PROBLEM OF THE DAY : 06/12/2023 | How Many X's?

 4 months ago
source link: https://www.geeksforgeeks.org/videos/problem-of-the-day-06122023-how-many-xs/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

PROBLEM OF THE DAY : 06/12/2023

December 07, 2023 |1.1K Views
PROBLEM OF THE DAY : 06/12/2023 | How Many X's?
Problem of the Day, maths, Data Structure and Algorithm
 Save  Share  2 Likes
Description
Discussion

Welcome to the daily solving of our PROBLEM OF THE DAY with Karan Mashru. We will discuss the entire problem step-by-step and work towards developing an optimized solution. This will not only help you brush up on your concepts of Maths but also build up problem-solving skills.

In this problem, we are given,  two integers L, R, and digit X. Find the number of occurrences of X in all the numbers in the range (L, R) excluding L and R.

Example :

Input:
L=10, R=19, X=1
Output:
9

Explanation:
There are 9 1s (11, 12, 13, 14, 15, 16, 17, 18) in the numbers in the range (10,19).

Give the problem a try before going through the video. All the best!!!
Problem Link: https://practice.geeksforgeeks.org/problems/how-many-xs4514/1

Read More

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK