Question: Given two positive numbers N and M, find minimal |c — M| where N mod c = 0
Can we solve this problem in O(log (n))
or faster ?
Here is my approach in O(sqrt(n))
My code
Sorry for my bad English ;-;
If I have wrong something, please tell me. It is better to do that than just downvote me because I and someone will learn many new things <3