Practical Programming Practices: Number of 3 digits number, made from 2 digits drawn from 1-9

preview_player
Показать описание
This time, lets practice our programming using a mathematical question! We have a bag of numbers from 1 to 9. We draw 2 and create all the 3 digit numbers using them. How many possible numbers we can create?

Using maths, the answer is not that difficult but using programming, its even simpler. We will learn how to separate digits of a number, how to count in our loop and some other fun tricks! in #Rust but you can use your own language.
Рекомендации по теме
Комментарии
Автор

Instead of using a HashSet I used an array of size 10 to represent the amount of digits encountered. Doing this I was able to create a Rust solution that was around 9-10 times faster. The overhead of computing the hash value, instead of simply indexing into the array is probably the culprit here.

aab
Автор

I will keep commenting til this channel gets the attention it deserves. Good tech videos mate!

alemail
Автор

خودتم میدونی کارت درسته دیگه لازم نیست من بگم😂❤

RadmanMoeini