Smallest Integer Divisible by K | Leet code 1015 | Theory explained + Python code

preview_player
Показать описание
This video is a solution to Leet code 1015, Smallest Integer Divisible by K. I explain the question, go over how the logic / theory behind solving the question and finally solve it using Python code.

Comment below if you have a better solution to this problem!

Let me know if you have any feedback and don't forget to subscribe for more videos!

Time stamps:
0:00 Question Explained
1:38 Solution Explained
4:53 Python Code

Code:

More leetcode questions solved:
Рекомендации по теме
Комментарии
Автор

If we take num = (num*10 + 1) % k it will ease the calculation and avoid calculating mod of huge numbers

midhileshmomidi
Автор

For example the number 187, how did you discover that when that number ends with unit 7 there is a divisor for it, even without performing the division manually?

And how do you guarantee that if a number ends with these units it will not generate an infinite loop?

joaopauloalvesdasilva
Автор

It would be great if you could add Time complexity and space complexity in the videos explaining please

hrishekessaraghueeti
Автор

Can you make playlist of array string like that, it easy for beginners

rutvikghori
Автор

The guessing of the rule is not obvious. Even if we can know 1, 3, 7, 9 can get an answer, it's unlikely to make sure that 13 also can get an answer based on that. Some kind of steps must be missing.

aria
visit shbcf.ru