'algorithm to find the first number in a range that can devided a certain number?
I want to optimize my code and I feel there could be a better algorithm for my problem.Here is the thing: given a range of numbers [lower,upper] and a certain number K(K>=upper>lower),to find the first number in the range that (K % number ==0).what is the best solution for that? I can only come up with the brute force solution but they are too slow for my program.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
