We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Coding Friends
- Discussions
Coding Friends
Coding Friends
Sort by
recency
|
7 Discussions
|
Please Login in order to post a comment
**Binary Search approach ** bool canSurpass(int samDaily, int kellyDaily, int difference, int days) { int samSolved = difference + days * samDaily; int kellySolved = days * kellyDaily; return kellySolved > samSolved; }
int minNum(int samDaily, int kellyDaily, int difference) { if (samDaily >= kellyDaily) { return -1; }
}****
JAVA Solution:
How the problem is constructed at first is a bit confusing, but once you get the general idea. That's the time you realize it's not so difficult.
You only need to understand and get only the minimum number of days that personA will exceed number of problems solve against personB.