/leetcode-cpp

Leetcode Solutions in Modern-ish C++

Primary LanguageC++MIT LicenseMIT

LeetCode Solutions in C++

This is a repository of the LeetCode problems I have started solving in 2020. An attempt has been made to use C++ with modern features. Since this is an attempt at learning, some initial solutions might lack some awesome modern C++ idioms. They will improve them as I revisit some of those constucts/problems.

Algorithms Explained

Once in a while, when I find an awesome algorithm which is a little hard to understand, I try to explain it in a discussion post. Linking all those here (in a sorted order).

Variable Naming

  • If pSomething is of type int, that means it's a moving index
  • Binary searches use lo, hi and mid for low, high and middle elements