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.
- Host: GitHub
- URL: https://github.com/suprio-das/top-300-leetcode-problems
- Owner: Suprio-Das
- Created: 2025-04-10T11:17:07.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-17T20:03:07.000Z (about 1 year ago)
- Last Synced: 2025-04-18T06:48:37.443Z (about 1 year ago)
- Topics: algorithms, dsa, dynamic-programming, leetcode-cpp, problem-solving
- Language: C++
- Homepage:
- Size: 48.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
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`.