Message on Whatsapp 8879355057 for DSA(OA + Interview) + Fullstack Dev Training + 1-1 Personalized Mentoring to get 10+LPA Job
0 like 0 dislike
1,819 views
in Online Assessments by Expert (34,270 points) | 1,819 views

1 Answer

0 like 0 dislike
Recently i appeared for Deloitte Assesment and this coding question felt nearly impossible please if someone could guide an approach
You are given with two integers N and D find all the N digit Prime Numbers having D as their most frequent digit. E.g. if N=2 and D=3 so we have to find 2 digit integers having 3 as the most frequent digit so answer will be [13,23,31,37,43,53,73,83] as these contain 3 as the most frequent digit

 

Constraint for D is 1<=D<=9
Constraint for N is 0<=N<= 10^18

 

10^18 digits how would you do that i have this doubt
by Expert (34,270 points)