Leetcode Solution : Count Good Numbers

preview_player
Показать описание
My contact details

You can practice for coding interview from here

I am Mohammad Fraz, a final year Engineer at DTU and I create content for Coding and technical interviews for FAANG. I explain the intuition to solve Data Structure and Algorithm Questions from leetcode and other platforms. I also cover interview experiences for FAANG and other tech giants. You will also find lectures on the frequently asked interview questions.

#leetcodesolutions #leetcode #codinginterviews
Рекомендации по теме
Комментарии
Автор

from this solution only 70/166 test cases are getting cleared . rest it's giving out of bond exception. the solution needs to be optimized

wasi
Автор

int countGoodNumber(long n){
int ans = 1;
int modu = 1e9 + 7;
//int modu = pow(10, 9) + 8;
//instead 1e9+ 7 we are use pow(10, 9) + 8;
// code gives tle after the 69 test case
for(int i = 0; i<n; i++){
if(i%2 == 0){
ans = (ans * 5) % modu;
}
else{
ans = (ans * 4) % modu;
}
}
return ans;
}
brute force solution

dipanshuraj
Автор

sir in this we can't keep 0 at first for any case

kshitijsingla
Автор

first got to know you through service to product based swith podcast (that pushed me to prepare), now watching your solutions for my preparation to come to your podcast 😄

ritikshandilya
Автор

Excellent explanation unfortunately from 10:00-14:00 the full notepad isnt shown.

rsKayiira
Автор

waah bahhiya really maja Aa gya crystal clear concept taught by you ❤️

vivek_
Автор

how many questions should one be able to solve in leetcode contest in order to assure himself that he can crack dsa rounds of product based companies.

BEEMohdArbazAli
Автор

bhai half video is showing and half is not..??like vdo revie to karo

Sp_Global-octf
Автор

bhaiya 4th question ko kaise krey ?, longest common substring 2 string/array mai dp se nikal sakte hai but n different main kaise krenge

mickyman
Автор

can make that y in power as int datatype, although doesn't do much improvement

mickyman
Автор

Why we use 5 and 4 I'm not able to understand this solution and approch

kirtanprajapati
Автор

Lecture boring laga thoda, smjhne ke badh maja agaya XD

sardarji
Автор

But first digit can't be 0 for n number of digits number, it should be 4 instead of 5 then how it is working? Can anybody explain?

yashikaagrawal
Автор

Thank You So Much Fraz one question though, have you solved it by yourself when tried for the first time or checked the solution?

stith_pragya
Автор

bhai please solve atleast one question of content daily
so that we can easily be consistent and able to crack OA

_danishranjan
Автор

To be very honest the explanation is not so good bhai.

arkamukherjee
Автор

Thank you soo much bhai for this beautiful explanation 🙌

art.with.drawings
Автор

Bhaiya please upload 4th one also. Thank you.

babbarutkarsh
Автор

Shitt code quality and lack of to depth explanation

sheetanshugautam
Автор

Tumhare course se jyada to tumhari Youtube ki Videos se sikh leta hoon, vo dadi wale baba ne mood khrab kr diya course me
Seperate Course Banalo tumhari Personal Branding Khrab kr rha vo

yogeshsahni
join shbcf.ru