Skip to content

Sanskar-Agrawal01/LeetCodeSolutions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

386 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LeetCodeSolutions

LeetCode Topics

Array

0042-trapping-rain-water
0200-number-of-islands
0419-battleships-in-a-board
1288-remove-covered-intervals
1331-rank-transform-of-an-array
1732-find-the-highest-altitude
1752-check-if-array-is-sorted-and-rotated
1828-queries-on-number-of-points-inside-a-circle
1833-maximum-ice-cream-bars
1840-maximum-building-height
1846-maximum-element-after-decreasing-and-rearranging
1967-number-of-strings-that-appear-as-substrings-in-word
2126-destroying-asteroids
2144-minimum-cost-of-buying-candies-with-discount
2161-partition-array-according-to-given-pivot
2196-create-binary-tree-from-descriptions
2226-maximum-candies-allocated-to-k-children
2574-left-and-right-sum-differences
2812-find-the-safest-path-in-a-grid
3020-find-the-maximum-number-of-elements-in-subset
3043-find-the-length-of-the-longest-common-prefix
3286-find-a-safe-walk-through-a-grid
3559-number-of-ways-to-assign-edge-weights-ii
3620-network-recovery-pathways
3633-earliest-finish-time-for-land-and-water-rides-i
3689-maximum-total-subarray-value-i
3838-weighted-word-mapping

Hash Table

0205-isomorphic-strings
1189-maximum-number-of-balloons
1331-rank-transform-of-an-array
1358-number-of-substrings-containing-all-three-characters
2196-create-binary-tree-from-descriptions
3020-find-the-maximum-number-of-elements-in-subset
3043-find-the-length-of-the-longest-common-prefix
3120-count-the-number-of-special-characters-i

String

0072-edit-distance
0205-isomorphic-strings
1189-maximum-number-of-balloons
1358-number-of-substrings-containing-all-three-characters
1967-number-of-strings-that-appear-as-substrings-in-word
2042-check-if-numbers-are-ascending-in-a-sentence
3043-find-the-length-of-the-longest-common-prefix
3120-count-the-number-of-special-characters-i
3612-process-string-with-special-operations-i
3614-process-string-with-special-operations-ii
3756-concatenate-non-zero-digits-and-multiply-by-sum-ii
3838-weighted-word-mapping

Trie

3043-find-the-length-of-the-longest-common-prefix

Two Pointers

0042-trapping-rain-water
0061-rotate-list
0148-sort-list
2095-delete-the-middle-node-of-a-linked-list
2130-maximum-twin-sum-of-a-linked-list
2161-partition-array-according-to-given-pivot
3633-earliest-finish-time-for-land-and-water-rides-i

Dynamic Programming

0042-trapping-rain-water
0072-edit-distance
0968-binary-tree-cameras
3559-number-of-ways-to-assign-edge-weights-ii
3620-network-recovery-pathways
3751-total-waviness-of-numbers-in-range-i

Stack

0042-trapping-rain-water
2130-maximum-twin-sum-of-a-linked-list

Monotonic Stack

0042-trapping-rain-water

Tree

0226-invert-binary-tree
0236-lowest-common-ancestor-of-a-binary-tree
0968-binary-tree-cameras
2196-create-binary-tree-from-descriptions
2331-evaluate-boolean-binary-tree
3558-number-of-ways-to-assign-edge-weights-i
3559-number-of-ways-to-assign-edge-weights-ii

Depth-First Search

0200-number-of-islands
0226-invert-binary-tree
0236-lowest-common-ancestor-of-a-binary-tree
0419-battleships-in-a-board
0968-binary-tree-cameras
2331-evaluate-boolean-binary-tree
2492-minimum-score-of-a-path-between-two-cities
2685-count-the-number-of-complete-components
3558-number-of-ways-to-assign-edge-weights-i
3559-number-of-ways-to-assign-edge-weights-ii

Binary Tree

0226-invert-binary-tree
0236-lowest-common-ancestor-of-a-binary-tree
0968-binary-tree-cameras
2196-create-binary-tree-from-descriptions
2331-evaluate-boolean-binary-tree

Breadth-First Search

0200-number-of-islands
0226-invert-binary-tree
2492-minimum-score-of-a-path-between-two-cities
2685-count-the-number-of-complete-components
2812-find-the-safest-path-in-a-grid
3286-find-a-safe-walk-through-a-grid

Linked List

0061-rotate-list
0148-sort-list
2095-delete-the-middle-node-of-a-linked-list
2130-maximum-twin-sum-of-a-linked-list

Greedy

1833-maximum-ice-cream-bars
1846-maximum-element-after-decreasing-and-rearranging
2126-destroying-asteroids
2144-minimum-cost-of-buying-candies-with-discount
3633-earliest-finish-time-for-land-and-water-rides-i
3689-maximum-total-subarray-value-i

Sorting

0148-sort-list
1288-remove-covered-intervals
1331-rank-transform-of-an-array
1833-maximum-ice-cream-bars
1840-maximum-building-height
1846-maximum-element-after-decreasing-and-rearranging
2126-destroying-asteroids
2144-minimum-cost-of-buying-candies-with-discount
3633-earliest-finish-time-for-land-and-water-rides-i

Binary Search

2226-maximum-candies-allocated-to-k-children
2812-find-the-safest-path-in-a-grid
3620-network-recovery-pathways
3633-earliest-finish-time-for-land-and-water-rides-i

Simulation

2161-partition-array-according-to-given-pivot
3612-process-string-with-special-operations-i
3614-process-string-with-special-operations-ii
3838-weighted-word-mapping

Prefix Sum

1732-find-the-highest-altitude
2574-left-and-right-sum-differences
3756-concatenate-non-zero-digits-and-multiply-by-sum-ii

Math

1344-angle-between-hands-of-a-clock
1828-queries-on-number-of-points-inside-a-circle
1840-maximum-building-height
3558-number-of-ways-to-assign-edge-weights-i
3559-number-of-ways-to-assign-edge-weights-ii
3751-total-waviness-of-numbers-in-range-i
3754-concatenate-non-zero-digits-and-multiply-by-sum-i
3756-concatenate-non-zero-digits-and-multiply-by-sum-ii

Enumeration

1291-sequential-digits
3020-find-the-maximum-number-of-elements-in-subset
3751-total-waviness-of-numbers-in-range-i

Bit Manipulation

3559-number-of-ways-to-assign-edge-weights-ii

Geometry

1828-queries-on-number-of-points-inside-a-circle

Counting Sort

1189-maximum-number-of-balloons
1833-maximum-ice-cream-bars

Union-Find

0200-number-of-islands
2492-minimum-score-of-a-path-between-two-cities
2685-count-the-number-of-complete-components
2812-find-the-safest-path-in-a-grid

Matrix

0200-number-of-islands
0419-battleships-in-a-board
2812-find-the-safest-path-in-a-grid
3286-find-a-safe-walk-through-a-grid

Sliding Window

1358-number-of-substrings-containing-all-three-characters

Divide and Conquer

0148-sort-list

Merge Sort

0148-sort-list

Heap (Priority Queue)

2812-find-the-safest-path-in-a-grid
3286-find-a-safe-walk-through-a-grid
3620-network-recovery-pathways

Graph Theory

2492-minimum-score-of-a-path-between-two-cities
2685-count-the-number-of-complete-components
3286-find-a-safe-walk-through-a-grid
3620-network-recovery-pathways

Shortest Path

3286-find-a-safe-walk-through-a-grid
3620-network-recovery-pathways

Topological Sort

3620-network-recovery-pathways

About

A curated collection of my Java solutions to LeetCode problems, ranging from easy to hard. Well-structured, clean, and explained code to help improve problem-solving skills.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors