Lucky numbers programming interview question

preview_player
Показать описание
This video explains the code and trick behind how to find if a given number "n" is lucky or not. This question has come several times in microsoft interviews and this can even repeat in other company interviews. I would highly suggest to practice this question. The code link is given below. If you find any difficulty or have any query then do COMMENT below. PLEASE help our channel by SUBSCRIBING and LIKE our video if you found it helpful...CYA :)

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

Sir excellent .... Lots of love with you♥️

bikramdas
Автор

How u were able to get this exp np=np -np/counter ?

honeykaul
Автор

Dude!! perfect explanation, thank you!

SHRUGX_YT
Автор

Thanks for it. But in GeeksforGeeks compiler, this code wasn't working. The main point there was to re initialize counter=2 while returning true or false, from the function.

rishavsaha
Автор

What is the time complexity of this problem? Why you didn't spoke about the time complexity? I did the same code using while loop. O(logn) time and 0(1) space complexity. Why you didn't use this approach?

sakthim
Автор

sir ye counter globally declared hona chaiye na.

__VishalSharma
Автор

This code fails for 16649.
The O/P generated from your code is 1 while correct O/P is 0.

rajattalnikar
join shbcf.ru