r06922019 / coding_interview_practices

5 stars 0 forks source link

leetcode. 81 #1

Open acht7111020 opened 1 year ago

acht7111020 commented 1 year ago

why can we reverse the logic because of different groups 🤔
https://github.com/r06922019/coding_interview_practices/blob/master/leetcode/81.cpp#L25

r06922019 commented 1 year ago

It's more like we have to reverse the logic to maintain the properties to run binary search. I'd recommend checking https://leetcode.com/problems/search-in-rotated-sorted-array/ first then this one