Coder Social home page Coder Social logo

leetcode_solutions-2's Introduction

My name is Shantanu Singh Verma and here I will be documenting all the questions and solutions of the problems I will be solving on Leetcode.

The folder Structure is as follow:

Each folder consists of two files:

1) README.md file which contains the problem statement.

2) C++ solutions of the questions.

The questions and solutions are automatically updated in the repository using the LeetSync and LeetHub v2 Chrome Extension.

Incase of any suggestions for the solutions, feel free to pull the repository and push the changes.

String

0344-reverse-string
1044-find-common-characters
3379-score-of-a-string

Database

0608-tree-node
0627-swap-salary

Two Pointers

0075-sort-colors
0344-reverse-string
0633-sum-of-square-numbers
0853-most-profit-assigning-work

Array

0075-sort-colors
0128-longest-consecutive-sequence
0330-patching-array
0502-ipo
0777-toeplitz-matrix
0853-most-profit-assigning-work
0876-hand-of-straights
0982-minimum-increment-to-make-array-unique
1016-subarray-sums-divisible-by-k
1037-minimum-number-of-k-consecutive-bit-flips
1044-find-common-characters
1137-height-checker
1138-grumpy-bookstore-owner
1217-relative-sort-array
1370-count-number-of-nice-subarrays
1549-longest-continuous-subarray-with-absolute-diff-less-than-or-equal-to-limit
1605-minimum-number-of-days-to-make-m-bouquets
1675-magnetic-force-between-two-balls
1938-minimum-operations-to-make-the-array-increasing
2148-minimum-number-of-moves-to-seat-everyone

Hash Table

0128-longest-consecutive-sequence
0876-hand-of-straights
1016-subarray-sums-divisible-by-k
1044-find-common-characters
1217-relative-sort-array
1370-count-number-of-nice-subarrays

Union Find

0128-longest-consecutive-sequence

Greedy

0330-patching-array
0502-ipo
0853-most-profit-assigning-work
0876-hand-of-straights
0982-minimum-increment-to-make-array-unique
1285-balance-a-binary-search-tree
1938-minimum-operations-to-make-the-array-increasing
2148-minimum-number-of-moves-to-seat-everyone

Sorting

0075-sort-colors
0502-ipo
0853-most-profit-assigning-work
0876-hand-of-straights
0982-minimum-increment-to-make-array-unique
1137-height-checker
1217-relative-sort-array
1675-magnetic-force-between-two-balls
2148-minimum-number-of-moves-to-seat-everyone

Prefix Sum

1016-subarray-sums-divisible-by-k
1037-minimum-number-of-k-consecutive-bit-flips

Counting Sort

0982-minimum-increment-to-make-array-unique
1137-height-checker
1217-relative-sort-array

Heap (Priority Queue)

0502-ipo
1549-longest-continuous-subarray-with-absolute-diff-less-than-or-equal-to-limit

Math

0633-sum-of-square-numbers
1370-count-number-of-nice-subarrays

Binary Search

0633-sum-of-square-numbers
0853-most-profit-assigning-work
1605-minimum-number-of-days-to-make-m-bouquets
1675-magnetic-force-between-two-balls

Sliding Window

1037-minimum-number-of-k-consecutive-bit-flips
1138-grumpy-bookstore-owner
1370-count-number-of-nice-subarrays
1549-longest-continuous-subarray-with-absolute-diff-less-than-or-equal-to-limit

Queue

1037-minimum-number-of-k-consecutive-bit-flips
1549-longest-continuous-subarray-with-absolute-diff-less-than-or-equal-to-limit

Ordered Set

1549-longest-continuous-subarray-with-absolute-diff-less-than-or-equal-to-limit

Monotonic Queue

1549-longest-continuous-subarray-with-absolute-diff-less-than-or-equal-to-limit

Bit Manipulation

1037-minimum-number-of-k-consecutive-bit-flips

Tree

1114-binary-search-tree-to-greater-sum-tree
1285-balance-a-binary-search-tree

Depth-First Search

1114-binary-search-tree-to-greater-sum-tree
1285-balance-a-binary-search-tree

Binary Search Tree

1114-binary-search-tree-to-greater-sum-tree
1285-balance-a-binary-search-tree

Binary Tree

1114-binary-search-tree-to-greater-sum-tree
1285-balance-a-binary-search-tree

Divide and Conquer

1285-balance-a-binary-search-tree

Matrix

0777-toeplitz-matrix

LeetCode Topics

Greedy

0624-maximum-distance-in-arrays
0890-lemonade-change
1616-minimum-difference-between-largest-and-smallest-value-in-three-moves
1659-get-the-maximum-score
1711-find-valid-matrix-given-row-and-column-sums
2379-maximum-total-importance-of-roads
2450-minimum-replacements-to-sort-the-array

Graph

0984-most-stones-removed-with-same-row-or-column
1325-path-with-maximum-probability
1431-all-ancestors-of-a-node-in-a-directed-acyclic-graph
1701-remove-max-number-of-edges-to-keep-graph-fully-traversable
2379-maximum-total-importance-of-roads
2472-build-a-matrix-with-conditions
2803-modify-graph-edge-weights

Sorting

0350-intersection-of-two-arrays-ii
0719-find-k-th-smallest-pair-distance
0726-number-of-atoms
1616-minimum-difference-between-largest-and-smallest-value-in-three-moves
2379-maximum-total-importance-of-roads
2502-sort-the-people
2846-robot-collisions

Heap (Priority Queue)

0264-ugly-number-ii
0789-kth-largest-element-in-a-stream
1325-path-with-maximum-probability
2379-maximum-total-importance-of-roads
2803-modify-graph-edge-weights

Depth-First Search

0145-binary-tree-postorder-traversal
0776-n-ary-tree-postorder-traversal
0984-most-stones-removed-with-same-row-or-column
0999-regions-cut-by-slashes
1207-delete-nodes-and-return-forest
1431-all-ancestors-of-a-node-in-a-directed-acyclic-graph
1653-number-of-good-leaf-nodes-pairs
1691-minimum-number-of-days-to-disconnect-island
2217-step-by-step-directions-from-a-binary-tree-node-to-another

Breadth-First Search

0999-regions-cut-by-slashes
1431-all-ancestors-of-a-node-in-a-directed-acyclic-graph
1691-minimum-number-of-days-to-disconnect-island

Topological Sort

1431-all-ancestors-of-a-node-in-a-directed-acyclic-graph
2472-build-a-matrix-with-conditions

Union Find

0984-most-stones-removed-with-same-row-or-column
0999-regions-cut-by-slashes
1701-remove-max-number-of-edges-to-keep-graph-fully-traversable

Array

0040-combination-sum-ii
0063-unique-paths-ii
0064-minimum-path-sum
0120-triangle
0315-count-of-smaller-numbers-after-self
0350-intersection-of-two-arrays-ii
0377-combination-sum-iv
0624-maximum-distance-in-arrays
0719-find-k-th-smallest-pair-distance
0870-magic-squares-in-grid
0890-lemonade-change
0921-spiral-matrix-iii
0999-regions-cut-by-slashes
1025-minimum-cost-for-tickets
1207-delete-nodes-and-return-forest
1240-stone-game-ii
1293-three-consecutive-odds
1325-path-with-maximum-probability
1496-lucky-numbers-in-a-matrix
1616-minimum-difference-between-largest-and-smallest-value-in-three-moves
1659-get-the-maximum-score
1691-minimum-number-of-days-to-disconnect-island
1711-find-valid-matrix-given-row-and-column-sums
1720-crawler-log-folder
1803-average-waiting-time
1951-find-the-winner-of-the-circular-game
2067-maximum-number-of-points-with-cost
2163-kth-distinct-string-in-an-array
2306-create-binary-tree-from-descriptions
2450-minimum-replacements-to-sort-the-array
2472-build-a-matrix-with-conditions
2502-sort-the-people
2846-robot-collisions

Hash Table

0264-ugly-number-ii
0350-intersection-of-two-arrays-ii
0726-number-of-atoms
0870-magic-squares-in-grid
0984-most-stones-removed-with-same-row-or-column
0999-regions-cut-by-slashes
1207-delete-nodes-and-return-forest
2163-kth-distinct-string-in-an-array
2306-create-binary-tree-from-descriptions
2502-sort-the-people

Two Pointers

0350-intersection-of-two-arrays-ii
0719-find-k-th-smallest-pair-distance
1659-get-the-maximum-score

Binary Search

0315-count-of-smaller-numbers-after-self
0350-intersection-of-two-arrays-ii
0719-find-k-th-smallest-pair-distance

Linked List

2182-find-the-minimum-and-maximum-number-of-nodes-between-critical-points
2299-merge-nodes-in-between-zeros

Simulation

0592-fraction-addition-and-subtraction
0921-spiral-matrix-iii
1803-average-waiting-time
1951-find-the-winner-of-the-circular-game
2299-merge-nodes-in-between-zeros
2846-robot-collisions

Math

0062-unique-paths
0264-ugly-number-ii
0273-integer-to-english-words
0564-find-the-closest-palindrome
0592-fraction-addition-and-subtraction
0650-2-keys-keyboard
0870-magic-squares-in-grid
1240-stone-game-ii
1951-find-the-winner-of-the-circular-game
2450-minimum-replacements-to-sort-the-array

Recursion

0273-integer-to-english-words
1951-find-the-winner-of-the-circular-game

Queue

1951-find-the-winner-of-the-circular-game

String

0273-integer-to-english-words
0564-find-the-closest-palindrome
0592-fraction-addition-and-subtraction
0726-number-of-atoms
1298-reverse-substrings-between-each-pair-of-parentheses
1720-crawler-log-folder
2163-kth-distinct-string-in-an-array
2217-step-by-step-directions-from-a-binary-tree-node-to-another
2502-sort-the-people

Stack

0145-binary-tree-postorder-traversal
0726-number-of-atoms
0776-n-ary-tree-postorder-traversal
1298-reverse-substrings-between-each-pair-of-parentheses
1720-crawler-log-folder
2846-robot-collisions

Tree

0145-binary-tree-postorder-traversal
0776-n-ary-tree-postorder-traversal
0789-kth-largest-element-in-a-stream
1207-delete-nodes-and-return-forest
1653-number-of-good-leaf-nodes-pairs
2217-step-by-step-directions-from-a-binary-tree-node-to-another
2306-create-binary-tree-from-descriptions

Binary Tree

0145-binary-tree-postorder-traversal
0789-kth-largest-element-in-a-stream
1207-delete-nodes-and-return-forest
1653-number-of-good-leaf-nodes-pairs
2217-step-by-step-directions-from-a-binary-tree-node-to-another
2306-create-binary-tree-from-descriptions

Divide and Conquer

0315-count-of-smaller-numbers-after-self

Binary Indexed Tree

0315-count-of-smaller-numbers-after-self

Segment Tree

0315-count-of-smaller-numbers-after-self

Merge Sort

0315-count-of-smaller-numbers-after-self

Ordered Set

0315-count-of-smaller-numbers-after-self

Matrix

0063-unique-paths-ii
0064-minimum-path-sum
0870-magic-squares-in-grid
0921-spiral-matrix-iii
0999-regions-cut-by-slashes
1496-lucky-numbers-in-a-matrix
1691-minimum-number-of-days-to-disconnect-island
1711-find-valid-matrix-given-row-and-column-sums
2472-build-a-matrix-with-conditions

Dynamic Programming

0062-unique-paths
0063-unique-paths-ii
0064-minimum-path-sum
0120-triangle
0264-ugly-number-ii
0377-combination-sum-iv
0650-2-keys-keyboard
1025-minimum-cost-for-tickets
1240-stone-game-ii
1659-get-the-maximum-score
2067-maximum-number-of-points-with-cost

Database

0183-customers-who-never-order
1182-game-play-analysis-iv

Counting

2163-kth-distinct-string-in-an-array

Strongly Connected Component

1691-minimum-number-of-days-to-disconnect-island

Design

0789-kth-largest-element-in-a-stream

Binary Search Tree

0789-kth-largest-element-in-a-stream

Data Stream

0789-kth-largest-element-in-a-stream

Backtracking

0040-combination-sum-ii

Combinatorics

0062-unique-paths

Prefix Sum

1240-stone-game-ii

Game Theory

1240-stone-game-ii

Bit Manipulation

0476-number-complement

Shortest Path

1325-path-with-maximum-probability
2803-modify-graph-edge-weights

leetcode_solutions-2's People

Contributors

shantanu2003 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.