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

https://github.com/suprio-das/top-300-leetcode-problems

In this repository I will keep the top 300 LeetCode problems that I have solved. I will keep all the solved problems here topic wise. I will try to solve problems every day and update here.
https://github.com/suprio-das/top-300-leetcode-problems

algorithms dsa dynamic-programming leetcode-cpp problem-solving

Last synced: 10 months ago
JSON representation

In this repository I will keep the top 300 LeetCode problems that I have solved. I will keep all the solved problems here topic wise. I will try to solve problems every day and update here.

Awesome Lists containing this project

README

          

# Top 300 LeetCode Problems Solving


In this repository I will keep the top 300 LeetCode problems that I have solved in LeetCode. I will keep all the solved problems here topicwise. I will try to solve problems every day and update here.

## 📘 Problem List

### 🔹 Array

#### 🟢 Problem 01: [Moving Zeroes](https://leetcode.com/problems/move-zeroes/)
**Description:**
Given an integer array `nums`, move all `0`'s to the end while maintaining the relative order of the non-zero elements.
**Note:** You must do this **in-place** without making a copy of the array.

#### 🟢 Problem 02: [Majority Elements](https://leetcode.com/problems/majority-element/)
**Description:**
Given an array `nums` of size `n`, return the majority element.

The majority element is the element that appears more than `⌊n / 2⌋` times. You may assume that the majority element always exists in the array.

Follow-up: Could you solve the problem in linear time and in `O(1)` space?

`This problem is solved by Boyer-Moore voting algorithm`

#### 🟢 Problem 03: [Remove Duplicates from Sorted Array](https://leetcode.com/problems/remove-duplicates-from-sorted-array/)
**Description:**
Given an integer array `nums` sorted in non-decreasing order, remove the duplicates in-place such that each unique element appears only once. The relative order of the elements should be kept the same. Then return the number of unique elements in `nums`.

#### 🟢 Problem 04: [Best Time to Buy and Sell Stock](https://leetcode.com/problems/best-time-to-buy-and-sell-stock/description/)
**Description:**
You are given an array `prices` where `prices[i]` is the price of a given stock on the ith day.
You want to maximize your `profit` by choosing a single day to buy one stock and choosing a different day in the future to sell that stock.

Return the maximum `profit` you can achieve from this transaction. If you cannot achieve any `profit`, return `0`.

#### 🟢 Problem 05: [Rotate Array](https://leetcode.com/problems/rotate-array/description/)
**Description:**
Given an integer array `nums`, rotate the array to the right by `k` steps, where `k` is non-negative.

---

### 🔹 Two Pointer

#### 🟢 Problem 01: [Two Sum](https://leetcode.com/problems/two-sum-ii-input-array-is-sorted/)
**Description:**
Given a `1-indexed` array of integers numbers that is already sorted in non-decreasing order, find two numbers such that they add up to a specific target number. Let these two numbers be numbers `[index1]` and numbers `[index2]` where `1 <= index1 < index2 <= numbers.length`.

Return the indices of the two numbers, `index1` and `index2`, added by one as an integer array `[index1, index2]` of length `2`.