When submitting a solution in C++, please select either C++14 (GCC 6-32) or C++17 (GCC 7-32) as your compiler. ×

KaTiWarn's blog

By KaTiWarn, history, 15 months ago, In English

Does anyone face problem like me? I found that when I tried to write two pointer, I am very confused and I struggle with my code for very long time. Sometimes, I easily bugged. How can I improve this?

  • Vote: I like it
  • +9
  • Vote: I do not like it

| Write comment?
»
15 months ago, # |
  Vote: I like it +1 Vote: I do not like it

You need to understand monotonocity. Why are we skipping items? Because they are going to be worse than what we are going to get. Easy peasy. When we have rotten apples, you throw them away.