Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ranveeraggarwal/leetcode-cpp

Leetcode Solutions in Modern-ish C++
https://github.com/ranveeraggarwal/leetcode-cpp

algorithms cpp leetcode

Last synced: 17 days ago
JSON representation

Leetcode Solutions in Modern-ish C++

Awesome Lists containing this project

README

        

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).

* [169 | Explanation of Moore's Algorithm (Ft. Star Wars)](https://leetcode.com/problems/majority-element/discuss/616285/169-explanation-of-moores-algorithm-ft-star-wars)

## 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