Ones and Zeros Multiple (SPOJ / Polish Olympiad)

Given N, find the smallest multiple of N with only digits 0 and 1 in the decimal system. Let's solve this very old problem from Polish Olympiad in Informatics. I describe the solution in first 10 minutes, then it's mainly talking about implementation, proof of correctness, and alternative approaches. Surprisingly, we'll use graphs and BFS in this problem. You can submit your solution here https://www.spoj.com/problems/ONEZERO/. There's also a version with slightly higher limits https://szkopul.edu.pl/problemset/pro.... Subscribe for more educational videos on algorithms, coding interviews and competitive programming. Github repository: https://github.com/Errichto/youtube Live streams on 2nd YT channel and on Twitch:    / errichto2   &   / errichto   FB and Twitter:   / errichto   &   / errichto   Frequently Asked Questions: https://github.com/Errichto/youtube/w... #Coding #Programming