拖延症太严重了,原本打算参加leetcode四月份的每日挑战,结果已经结束了。
五月份的直到今天才开始准备。
补充5/13:
刷了两道五月挑战题
1. First bad version:
key: using binary search,
issue: not familiar with the template, e.g., left and right initial values, loop end condition, how to reset left/right (left = mid? left = mid +1? right = mid? right = mid -1?) as well as final result (left? left -1? left+1? right?)
next step: Need to fully understand the concept for binary search.
2. Jewels and Stones
key: hash set to quickly - O(1), find out wether an element should be included or not.
issue: syntax for hash set (unordered set)'s available APIs, e.g., count, find, insert
next step: Need to review c++ containers APIs
试图解决 remove k digits, however, couldn't sovle it. I was on the right path and considered to use monotonically increasing stack, however, I made a mistake when trying it with an example and gave it up, also am not clear/familiar with this concept.
Goal for the next day:
1. finish remove k digits, and get familiar with monotonically inscreasing stack.
2. finish passdue May questions.