Skip to content

This repository contains my curated solutions to LeetCode and GeeksforGeeks problems, written in C++ and SQL. Each solution is optimized for performance and includes time and space complexity notes. The repo is auto-synced using LeetHub to track my daily problem-solving progress.

Notifications You must be signed in to change notification settings

Mansiikumarii/LeetCode-GfG

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

đź§  LeetCode-GfG Solutions Vault

Welcome to the LeetCode-GfG repository! 🚀
A neatly organized collection of coding solutions for problems from LeetCode and GeeksforGeeks—solved, tested, and time-stamped for future reference.

LeetHub Sync Total Problems Last Commit

📌 What's Inside?

  • âś… 300+ LeetCode Problems (Easy to Hard)
  • âś… GfG Practice Questions
  • âś… Optimized code with runtime & memory stats
  • âś… Regular updates via LeetHub

đź§© Problem Categories

  • Arrays & Strings
  • Linked Lists
  • Trees & Graphs
  • DP & Backtracking
  • SQL & Database Queries
  • And more...

🔄 Auto-Sync Enabled

All solutions are auto-pushed using LeetHub, so you'll always find the latest versions here.

đźš§ Work in Progress

This repo is actively maintained. More problems coming soon!


👩‍💻 By Mansiiiiiiiiiiiiiiiii
🗂️ Last updated: Automatically via LeetHub

LeetCode Topics

Array

0001-two-sum
0011-container-with-most-water
0026-remove-duplicates-from-sorted-array
0033-search-in-rotated-sorted-array
0034-find-first-and-last-position-of-element-in-sorted-array
0048-rotate-image
0054-spiral-matrix
0074-search-a-2d-matrix
0088-merge-sorted-array
0108-convert-sorted-array-to-binary-search-tree
0121-best-time-to-buy-and-sell-stock
0134-gas-station
0136-single-number
0152-maximum-product-subarray
0162-find-peak-element
0167-two-sum-ii-input-array-is-sorted
0189-rotate-array
0198-house-robber
0204-count-primes
0209-minimum-size-subarray-sum
0213-house-robber-ii
0240-search-a-2d-matrix-ii
0283-move-zeroes
0287-find-the-duplicate-number
0349-intersection-of-two-arrays
0410-split-array-largest-sum
0414-third-maximum-number
0496-next-greater-element-i
0724-find-pivot-index
0747-min-cost-climbing-stairs
0882-peak-index-in-a-mountain-array
0940-fruit-into-baskets
1019-squares-of-a-sorted-array
1034-subarrays-with-k-different-integers
1046-max-consecutive-ones-iii
1171-shortest-path-in-binary-matrix
1305-number-of-visible-people-in-a-queue
1319-unique-number-of-occurrences
1335-maximum-candies-allocated-to-k-children
1408-find-the-smallest-divisor-given-a-threshold
1435-xor-queries-of-a-subarray
1603-running-sum-of-1d-array
1878-check-if-array-is-sorted-and-rotated
2195-time-needed-to-buy-tickets
3755-maximum-product-of-first-and-last-elements-of-a-subsequence

Binary Search

0033-search-in-rotated-sorted-array
0034-find-first-and-last-position-of-element-in-sorted-array
0074-search-a-2d-matrix
0162-find-peak-element
0167-two-sum-ii-input-array-is-sorted
0209-minimum-size-subarray-sum
0240-search-a-2d-matrix-ii
0287-find-the-duplicate-number
0349-intersection-of-two-arrays
0410-split-array-largest-sum
0882-peak-index-in-a-mountain-array
1046-max-consecutive-ones-iii
1335-maximum-candies-allocated-to-k-children
1408-find-the-smallest-divisor-given-a-threshold

Dynamic Programming

0070-climbing-stairs
0121-best-time-to-buy-and-sell-stock
0124-binary-tree-maximum-path-sum
0152-maximum-product-subarray
0198-house-robber
0213-house-robber-ii
0337-house-robber-iii
0410-split-array-largest-sum
0747-min-cost-climbing-stairs
1013-fibonacci-number

Greedy

0011-container-with-most-water
0134-gas-station
0410-split-array-largest-sum

Prefix Sum

0209-minimum-size-subarray-sum
0410-split-array-largest-sum
0724-find-pivot-index
1046-max-consecutive-ones-iii
1435-xor-queries-of-a-subarray
1603-running-sum-of-1d-array

Math

0048-rotate-image
0070-climbing-stairs
0168-excel-sheet-column-title
0171-excel-sheet-column-number
0189-rotate-array
0204-count-primes
1013-fibonacci-number
1411-convert-binary-number-in-a-linked-list-to-integer
2481-strictly-palindromic-number

String

0020-valid-parentheses
0125-valid-palindrome
0168-excel-sheet-column-title
0171-excel-sheet-column-number
0344-reverse-string
0567-permutation-in-string
1128-remove-all-adjacent-duplicates-in-string
1567-maximum-number-of-vowels-in-a-substring-of-given-length
2021-remove-all-occurrences-of-a-substring

Two Pointers

0011-container-with-most-water
0019-remove-nth-node-from-end-of-list
0026-remove-duplicates-from-sorted-array
0061-rotate-list
0086-partition-list
0088-merge-sorted-array
0125-valid-palindrome
0141-linked-list-cycle
0142-linked-list-cycle-ii
0160-intersection-of-two-linked-lists
0167-two-sum-ii-input-array-is-sorted
0189-rotate-array
0234-palindrome-linked-list
0283-move-zeroes
0287-find-the-duplicate-number
0344-reverse-string
0349-intersection-of-two-arrays
0567-permutation-in-string
0908-middle-of-the-linked-list
1019-squares-of-a-sorted-array
2481-strictly-palindromic-number
3755-maximum-product-of-first-and-last-elements-of-a-subsequence

Sorting

0088-merge-sorted-array
0349-intersection-of-two-arrays
0414-third-maximum-number
1019-squares-of-a-sorted-array
1427-all-elements-in-two-binary-search-trees

Sliding Window

0209-minimum-size-subarray-sum
0567-permutation-in-string
0940-fruit-into-baskets
1034-subarrays-with-k-different-integers
1046-max-consecutive-ones-iii
1567-maximum-number-of-vowels-in-a-substring-of-given-length

Hash Table

0001-two-sum
0141-linked-list-cycle
0142-linked-list-cycle-ii
0146-lru-cache
0160-intersection-of-two-linked-lists
0349-intersection-of-two-arrays
0496-next-greater-element-i
0567-permutation-in-string
0940-fruit-into-baskets
1034-subarrays-with-k-different-integers
1319-unique-number-of-occurrences

Counting

1034-subarrays-with-k-different-integers

Bit Manipulation

0136-single-number
0287-find-the-duplicate-number
1435-xor-queries-of-a-subarray

Linked List

0019-remove-nth-node-from-end-of-list
0061-rotate-list
0083-remove-duplicates-from-sorted-list
0086-partition-list
0092-reverse-linked-list-ii
0141-linked-list-cycle
0142-linked-list-cycle-ii
0146-lru-cache
0160-intersection-of-two-linked-lists
0203-remove-linked-list-elements
0206-reverse-linked-list
0234-palindrome-linked-list
0237-delete-node-in-a-linked-list
0908-middle-of-the-linked-list
1411-convert-binary-number-in-a-linked-list-to-integer

Recursion

0203-remove-linked-list-elements
0206-reverse-linked-list
0234-palindrome-linked-list
1013-fibonacci-number

Stack

0020-valid-parentheses
0144-binary-tree-preorder-traversal
0145-binary-tree-postorder-traversal
0155-min-stack
0234-palindrome-linked-list
0496-next-greater-element-i
1128-remove-all-adjacent-duplicates-in-string
1305-number-of-visible-people-in-a-queue
2021-remove-all-occurrences-of-a-substring

Design

0146-lru-cache
0155-min-stack

Monotonic Stack

0496-next-greater-element-i
1305-number-of-visible-people-in-a-queue

Queue

2195-time-needed-to-buy-tickets

Simulation

0054-spiral-matrix
2021-remove-all-occurrences-of-a-substring
2195-time-needed-to-buy-tickets

Doubly-Linked List

0146-lru-cache

Tree

0100-same-tree
0101-symmetric-tree
0102-binary-tree-level-order-traversal
0103-binary-tree-zigzag-level-order-traversal
0104-maximum-depth-of-binary-tree
0107-binary-tree-level-order-traversal-ii
0108-convert-sorted-array-to-binary-search-tree
0110-balanced-binary-tree
0112-path-sum
0124-binary-tree-maximum-path-sum
0144-binary-tree-preorder-traversal
0145-binary-tree-postorder-traversal
0199-binary-tree-right-side-view
0226-invert-binary-tree
0337-house-robber-iii
0543-diameter-of-binary-tree
1254-deepest-leaves-sum
1427-all-elements-in-two-binary-search-trees
1450-delete-leaves-with-a-given-value

Breadth-First Search

0100-same-tree
0101-symmetric-tree
0102-binary-tree-level-order-traversal
0103-binary-tree-zigzag-level-order-traversal
0104-maximum-depth-of-binary-tree
0107-binary-tree-level-order-traversal-ii
0112-path-sum
0199-binary-tree-right-side-view
0226-invert-binary-tree
0547-number-of-provinces
0744-network-delay-time
1171-shortest-path-in-binary-matrix
1254-deepest-leaves-sum

Binary Tree

0100-same-tree
0101-symmetric-tree
0102-binary-tree-level-order-traversal
0103-binary-tree-zigzag-level-order-traversal
0104-maximum-depth-of-binary-tree
0107-binary-tree-level-order-traversal-ii
0108-convert-sorted-array-to-binary-search-tree
0110-balanced-binary-tree
0112-path-sum
0124-binary-tree-maximum-path-sum
0144-binary-tree-preorder-traversal
0145-binary-tree-postorder-traversal
0199-binary-tree-right-side-view
0226-invert-binary-tree
0337-house-robber-iii
0543-diameter-of-binary-tree
1254-deepest-leaves-sum
1427-all-elements-in-two-binary-search-trees
1450-delete-leaves-with-a-given-value

Depth-First Search

0100-same-tree
0101-symmetric-tree
0104-maximum-depth-of-binary-tree
0110-balanced-binary-tree
0112-path-sum
0124-binary-tree-maximum-path-sum
0144-binary-tree-preorder-traversal
0145-binary-tree-postorder-traversal
0199-binary-tree-right-side-view
0226-invert-binary-tree
0337-house-robber-iii
0543-diameter-of-binary-tree
0547-number-of-provinces
0744-network-delay-time
1254-deepest-leaves-sum
1427-all-elements-in-two-binary-search-trees
1450-delete-leaves-with-a-given-value

Binary Search Tree

0108-convert-sorted-array-to-binary-search-tree
1427-all-elements-in-two-binary-search-trees

Union Find

0547-number-of-provinces

Graph

0547-number-of-provinces
0744-network-delay-time

Divide and Conquer

0108-convert-sorted-array-to-binary-search-tree
0240-search-a-2d-matrix-ii

Heap (Priority Queue)

0744-network-delay-time

Shortest Path

0744-network-delay-time

Matrix

0048-rotate-image
0054-spiral-matrix
0074-search-a-2d-matrix
0240-search-a-2d-matrix-ii
1171-shortest-path-in-binary-matrix

Memoization

0070-climbing-stairs
1013-fibonacci-number

Enumeration

0204-count-primes

Number Theory

0204-count-primes

Brainteaser

2481-strictly-palindromic-number

About

This repository contains my curated solutions to LeetCode and GeeksforGeeks problems, written in C++ and SQL. Each solution is optimized for performance and includes time and space complexity notes. The repo is auto-synced using LeetHub to track my daily problem-solving progress.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published