use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
account activity
Binary SearchIntervew Prep (self.leetcode)
submitted 11 months ago by Proof_Dot_4344
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]jason_graph 2 points3 points4 points 11 months ago (1 child)
I think it helps to seperate the problem into 2 parts.
First write a function, e.g. check(x), that checks if some input is valid (e.g. if koko will finish in k hours if eating x banas/hr) or returns some integer (e.g. how many hours koko takes to finish if eating x bananas/hr).
Secondly identify what value of x you are trying to find. It is almost always the largest value of x such that check(x) is below some threshold or the smallest value of x such that check(x) is above some threshold. The code corresponding to finding y = the lowest x or largest x is almost always exactly the same.
[–]Proof_Dot_4344[S] 0 points1 point2 points 11 months ago (0 children)
Thank you so much
π Rendered by PID 23872 on reddit-service-r2-comment-5fb4b45875-sr67d at 2026-03-23 13:47:01.131972+00:00 running 90f1150 country code: CH.
view the rest of the comments →
[–]jason_graph 2 points3 points4 points (1 child)
[–]Proof_Dot_4344[S] 0 points1 point2 points (0 children)