https://github.com/dominiks01/leetcode
Daily Leetcode Progress Tracker.
https://github.com/dominiks01/leetcode
algorithms-and-data-structures c cpp learning leetcode
Last synced: 4 months ago
JSON representation
Daily Leetcode Progress Tracker.
- Host: GitHub
- URL: https://github.com/dominiks01/leetcode
- Owner: dominiks01
- Created: 2025-01-20T19:31:39.000Z (10 months ago)
- Default Branch: master
- Last Pushed: 2025-01-29T09:58:54.000Z (10 months ago)
- Last Synced: 2025-06-20T07:49:50.123Z (5 months ago)
- Topics: algorithms-and-data-structures, c, cpp, learning, leetcode
- Language: C
- Homepage: https://leetcode.com/u/dominiks01/
- Size: 34.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Leetcode problems
| LeetCode | Code | Description | Solution | Code |
| -------- | ---- | ---- | ---------- | --- |
| [3sum-closest](https://leetcode.com/problems/3sum-closest/description/) | 16 |Find Three intigers in `array` such that the sum is colosest to `target` | [C](./16/main.c) | Iterating over array + Two Pointers O(N2) |
| [4sum](https://leetcode.com/problems/4sum/description/) | 18 | Find all the unique quadruplets `nums[a]`, `nums[b]`, `nums[c]`, `nums[d]` such that `nums[a] + nums[b] + nums[c] + nums[d] == target` | [C](./18/main.c) |Double-loop over array + Two Pointers O(N3) |
| [Swap Nodes in Pairs](https://leetcode.com/problems/swap-nodes-in-pairs/) | 24 |Given a linked list, swap every two adjacent nodes and return its head. | [C](./24/main.c) |Simple Linked List Swap|
| [Divide Two Integers](https://leetcode.com/problems/divide-two-integers/) | 29 |Given two integers dividend and divisor, divide two integers without using multiplication, division, and mod operator.| [C](./29/main.c) |Bit Manipulation O(log(a)) Time and O(1) Space |
| [Min Stack](https://leetcode.com/problems/min-stack/description/) | 155 |Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.| [C++](./155/main.cpp) | State Encoding. Each new min-val is encoded as: `2 * new-min-value - min-val`, and retrived in same way: `pop()` -> `if(stack.top() < min-value)` -> `min-val = 2 * min-val - stack.top()` |
| [Trapping Rain Water II](https://leetcode.com/problems/trapping-rain-water-ii/description/) | 407 | Given an `m x n` integer matrix heightMap representing the height of each unit cell in a `2D` elevation map, return the volume of water it can trap after raining | [C++](./407/main.cpp) | MinHeap, water bounded with min values. |
| [Redundant Connection](https://leetcode.com/problems/redundant-connection/) | 684 | Return an edge that can be removed so that the resulting graph is a tree of n nodes. If there are multiple answers, return the answer that occurs last in the input. | [C++](./684/main.cpp) | Kruskal MST |
| [Find Eventual Safe States](https://leetcode.com/problems/find-eventual-safe-states/description/) | 802 | There is a directed graph of n nodes with each node labeled from 0 to n - 1. The graph is represented by a 0-indexed 2D integer array graph where graph[i] is an integer array of nodes adjacent to node i, meaning there is an edge from node i to each node in graph[i]. | [C++](./802/main.cpp) | Topological Sort on reversed Graph |
| [Count Servers that Communicate](https://leetcode.com/problems/count-servers-that-communicate/description/) | 1267 | You are given a map of a server center, represented as a m * n integer matrix grid, where 1 means that on that cell there is a server and 0 means that it is no server. Two servers are said to communicate if they are on the same row or on the same column. | [C++](./1267/main.cpp) | Finding isolated island (i is isolated if row[i].count() == 1 && col[i].count() == 1) |
| [Minimum Cost to Make at Least One Valid Path in a Grid](https://leetcode.com/problems/minimum-cost-to-make-at-least-one-valid-path-in-a-grid/description/) | 1368 | You will initially start at the upper left cell (0, 0). A valid path in the grid is a path that starts from the upper left cell (0, 0) and ends at the bottom-right cell (m - 1, n - 1) following the signs on the grid. The valid path does not have to be the shortest. | [C++](./1368/main.cpp) | Dijkstra Algorithm with 'virtual' edges with cost 1 where virtual means that edge was not in the graph at the begining |
| [Course Schedule IV](https://leetcode.com/problems/course-schedule-iv/) | 1462 | There are a total of numCourses courses you have to take, labeled from 0 to numCourses - 1. You are given an array prerequisites where prerequisites[i] = [ai, bi] indicates that you must take course ai first if you want to take course bi. | [C++](./1462/main.cpp) | Topological sort with Prerequisites propagation |
| [Map of Highest Peak](https://leetcode.com/problems/map-of-highest-peak/description/) | 1765 | Return an integer matrix height of size m x n where height[i][j] is cell (i, j)'s height. If there are multiple solutions, return any of them. | [C++](./1765/main.cpp) | - |
| [Grid Game](https://leetcode.com/problems/grid-game/) | 2017 | You are given a 0-indexed 2D array grid of size 2 x n, where grid[r][c] represents the number of points at position (r, c) on the matrix. Two robots are playing a game on this matrix. The first robot wants to minimize the number of points collected by the second robot. | [C++](./2017/main.cpp) | Two pointer sum maximizing (first row vs second row) |