/coding-

Welcome, Here you'll find a collection of my solutions to Data Structure and Algorithm questions from platforms like GeeksforGeeks and LeetCode. I love tackling these challenges and sharing my code with fellow developers. Feel free to explore, learn, and contribute to this growing library of solutions. Let's master the world of algorithms together

Primary LanguageC++

LeetCode Topics

Array

0001-two-sum
0015-3sum
0026-remove-duplicates-from-sorted-array
0034-find-first-and-last-position-of-element-in-sorted-array
0035-search-insert-position
0053-maximum-subarray
0066-plus-one
0073-set-matrix-zeroes
0074-search-a-2d-matrix
0075-sort-colors
0081-search-in-rotated-sorted-array-ii
0088-merge-sorted-array
0121-best-time-to-buy-and-sell-stock
0128-longest-consecutive-sequence
0136-single-number
0153-find-minimum-in-rotated-sorted-array
0162-find-peak-element
0167-two-sum-ii-input-array-is-sorted
0189-rotate-array
0209-minimum-size-subarray-sum
0217-contains-duplicate
0268-missing-number
0283-move-zeroes
0347-top-k-frequent-elements
0349-intersection-of-two-arrays
0485-max-consecutive-ones
0500-keyboard-row
0540-single-element-in-a-sorted-array
0560-subarray-sum-equals-k
0745-find-smallest-letter-greater-than-target
1878-check-if-array-is-sorted-and-rotated
2271-rearrange-array-elements-by-sign
2350-find-closest-number-to-zero

Binary Search

0034-find-first-and-last-position-of-element-in-sorted-array
0035-search-insert-position
0074-search-a-2d-matrix
0081-search-in-rotated-sorted-array-ii
0153-find-minimum-in-rotated-sorted-array
0162-find-peak-element
0167-two-sum-ii-input-array-is-sorted
0209-minimum-size-subarray-sum
0268-missing-number
0349-intersection-of-two-arrays
0374-guess-number-higher-or-lower
0540-single-element-in-a-sorted-array
0745-find-smallest-letter-greater-than-target

Hash Table

0001-two-sum
0073-set-matrix-zeroes
0128-longest-consecutive-sequence
0217-contains-duplicate
0242-valid-anagram
0268-missing-number
0347-top-k-frequent-elements
0349-intersection-of-two-arrays
0387-first-unique-character-in-a-string
0500-keyboard-row
0560-subarray-sum-equals-k
2427-first-letter-to-appear-twice

Math

0066-plus-one
0067-add-binary
0189-rotate-array
0268-missing-number
2032-largest-odd-number-in-string

Bit Manipulation

0067-add-binary
0136-single-number
0268-missing-number
2427-first-letter-to-appear-twice

Sorting

0015-3sum
0075-sort-colors
0088-merge-sorted-array
0217-contains-duplicate
0242-valid-anagram
0268-missing-number
0347-top-k-frequent-elements
0349-intersection-of-two-arrays
2646-kth-largest-sum-in-a-binary-tree

Two Pointers

0005-longest-palindromic-substring
0015-3sum
0026-remove-duplicates-from-sorted-array
0028-find-the-index-of-the-first-occurrence-in-a-string
0075-sort-colors
0088-merge-sorted-array
0125-valid-palindrome
0151-reverse-words-in-a-string
0167-two-sum-ii-input-array-is-sorted
0189-rotate-array
0283-move-zeroes
0344-reverse-string
0349-intersection-of-two-arrays
0392-is-subsequence
0647-palindromic-substrings
1894-merge-strings-alternately
2271-rearrange-array-elements-by-sign

String

0005-longest-palindromic-substring
0014-longest-common-prefix
0028-find-the-index-of-the-first-occurrence-in-a-string
0058-length-of-last-word
0067-add-binary
0125-valid-palindrome
0151-reverse-words-in-a-string
0242-valid-anagram
0344-reverse-string
0387-first-unique-character-in-a-string
0392-is-subsequence
0500-keyboard-row
0647-palindromic-substrings
0812-rotate-string
1078-remove-outermost-parentheses
1894-merge-strings-alternately
2032-largest-odd-number-in-string
2427-first-letter-to-appear-twice

String Matching

0028-find-the-index-of-the-first-occurrence-in-a-string
0812-rotate-string

Interactive

0374-guess-number-higher-or-lower

Dynamic Programming

0005-longest-palindromic-substring
0053-maximum-subarray
0121-best-time-to-buy-and-sell-stock
0392-is-subsequence
0647-palindromic-substrings

Matrix

0073-set-matrix-zeroes
0074-search-a-2d-matrix

Prefix Sum

0209-minimum-size-subarray-sum
0560-subarray-sum-equals-k

Divide and Conquer

0053-maximum-subarray
0347-top-k-frequent-elements

Sliding Window

0209-minimum-size-subarray-sum

Tree

2646-kth-largest-sum-in-a-binary-tree

Breadth-First Search

2646-kth-largest-sum-in-a-binary-tree

Binary Tree

2646-kth-largest-sum-in-a-binary-tree

Simulation

0067-add-binary
2271-rearrange-array-elements-by-sign

Union Find

0128-longest-consecutive-sequence

Stack

1078-remove-outermost-parentheses

Linked List

0237-delete-node-in-a-linked-list

Greedy

2032-largest-odd-number-in-string

Trie

0014-longest-common-prefix

Heap (Priority Queue)

0347-top-k-frequent-elements

Bucket Sort

0347-top-k-frequent-elements

Counting

0347-top-k-frequent-elements
0387-first-unique-character-in-a-string
2427-first-letter-to-appear-twice

Quickselect

0347-top-k-frequent-elements

Queue

0387-first-unique-character-in-a-string