A C++ solution to Leetcode 63. Unique Paths II, counting the number of unique paths in a grid with obstacles using dynamic programming.
A simple C++ solution to Leetcode 387. First Unique Character in a String.
A C++ solution to Leetcode 13. Roman to Integer using Hash table.
A C++ recursive approach to solve Leetcode 235. Lowest Common Ancestor of a Binary Search Tree.
Efficient code isn't just about speed; it's a recipe for reduced maintenance, fewer bugs, and improved readability. Discover how optimizing your code can streamline your development process, enhance software reliability, and create a user-friendly experience.
An example of defining a custom comparison for a std::set. A C++ solution for Leetcode 729. My Calendar I.
How to convert a 2D grid to a 1D vector to make the shifting operations simpler. The modulo operator helps loop back to the start of the vector after k shifts.
Discover how finding optimal solutions enhances your problem-solving skills, strengthens your debugging abilities, and builds a repository of knowledge. Engage with the coding community, self-assess your progress, and boost your confidence as a coder.
Two C++ approaches to solve Leetcode 368. Largest Divisible Subset. One uses recursion with dynamic programming. The other saves the memory by only storing the representative of the chains.
A Greedy approach for Leetcode challenge 1710. Maximum Units on a Truck. It is also an example of a comparison between STL's vectors in C++.