Skip to content

TinsaeTadesse17/Competitive-Programming

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⚔️ My CP Odyssey: ⚔️

This is where I chart my course through the world of competitive programming. This repo is my digital logbook, filled with my solutions to a whole bunch of challenges.

LeetCode Topics

Stack

0020-valid-parentheses
0042-trapping-rain-water
0071-simplify-path
0150-evaluate-reverse-polish-notation
0155-min-stack
0234-palindrome-linked-list
0496-next-greater-element-i
0503-next-greater-element-ii
0739-daily-temperatures
0776-n-ary-tree-postorder-traversal
0886-score-of-parentheses
0943-sum-of-subarray-minimums
0957-minimum-add-to-make-parentheses-valid
1002-maximum-width-ramp
1197-parsing-a-boolean-expression
1497-design-a-stack-with-increment-operation
1570-final-prices-with-a-special-discount-in-a-shop
1679-shortest-subarray-to-be-removed-to-make-array-sorted
1756-minimum-deletions-to-make-string-balanced
2095-minimum-number-of-swaps-to-make-the-string-balanced

Tree

0110-balanced-binary-tree
0116-populating-next-right-pointers-in-each-node
0199-binary-tree-right-side-view
0776-n-ary-tree-postorder-traversal
0988-flip-equivalent-binary-trees
1484-linked-list-in-binary-tree
2545-height-of-binary-tree-after-subtree-removal-queries
2646-kth-largest-sum-in-a-binary-tree
2677-cousins-in-binary-tree-ii

Depth-First Search

0110-balanced-binary-tree
0116-populating-next-right-pointers-in-each-node
0199-binary-tree-right-side-view
0386-lexicographical-numbers
0744-network-delay-time
0776-n-ary-tree-postorder-traversal
0803-cheapest-flights-within-k-stops
0984-most-stones-removed-with-same-row-or-column
0988-flip-equivalent-binary-trees
1350-remove-sub-folders-from-the-filesystem
1484-linked-list-in-binary-tree
2545-height-of-binary-tree-after-subtree-removal-queries
2677-cousins-in-binary-tree-ii

Math

0050-powx-n
0062-unique-paths
0150-evaluate-reverse-polish-notation
0241-different-ways-to-add-parentheses
0264-ugly-number-ii
0342-power-of-four
0539-minimum-time-difference
0592-fraction-addition-and-subtraction
0670-maximum-swap
0797-rabbits-in-forest
1013-fibonacci-number
1018-largest-perimeter-triangle
2050-count-good-numbers
2155-find-missing-observations
2187-vowels-of-all-substrings
2450-minimum-replacements-to-sort-the-array
2477-number-of-ways-to-reach-a-position-after-exactly-k-steps
2645-pass-the-pillow
2715-k-items-with-the-maximum-sum
2716-prime-subtraction-operation
2903-insert-greatest-common-divisors-in-linked-list
3555-final-array-state-after-k-multiplication-operations-i
3600-find-the-k-th-character-in-string-game-i

String

0003-longest-substring-without-repeating-characters
0020-valid-parentheses
0071-simplify-path
0076-minimum-window-substring
0179-largest-number
0214-shortest-palindrome
0241-different-ways-to-add-parentheses
0344-reverse-string
0424-longest-repeating-character-replacement
0539-minimum-time-difference
0567-permutation-in-string
0592-fraction-addition-and-subtraction
0649-dota2-senate
0768-partition-labels
0812-rotate-string
0886-score-of-parentheses
0920-uncommon-words-from-two-sentences
0926-find-and-replace-pattern
0957-minimum-add-to-make-parentheses-valid
1197-parsing-a-boolean-expression
1302-delete-characters-to-make-fancy-string
1304-longest-happy-string
1350-remove-sub-folders-from-the-filesystem
1667-find-kth-bit-in-nth-binary-string
1715-split-a-string-into-the-max-number-of-unique-substrings
1756-minimum-deletions-to-make-string-balanced
1923-sentence-similarity-iii
2076-sum-of-digits-of-string-after-convert
2095-minimum-number-of-swaps-to-make-the-string-balanced
2187-vowels-of-all-substrings
2232-adding-spaces-to-a-string
2494-sum-of-prefix-scores-of-strings
2580-circular-sentence
2599-take-k-of-each-character-from-left-and-right
2755-extra-characters-in-a-string
3174-minimum-number-of-changes-to-make-binary-string-beautiful
3195-separate-black-and-white-balls
3329-find-the-length-of-the-longest-common-prefix
3451-string-compression-iii

Simulation

0592-fraction-addition-and-subtraction
0906-walking-robot-simulation
1667-find-kth-bit-in-nth-binary-string
2006-find-the-student-that-will-replace-the-chalk
2076-sum-of-digits-of-string-after-convert
2132-convert-1d-array-into-2d-array
2155-find-missing-observations
2195-time-needed-to-buy-tickets
2232-adding-spaces-to-a-string
2299-merge-nodes-in-between-zeros
2343-count-unguarded-cells-in-the-grid
2411-spiral-matrix-iv
2645-pass-the-pillow
2692-take-gifts-from-the-richest-pile
3555-final-array-state-after-k-multiplication-operations-i
3600-find-the-k-th-character-in-string-game-i

Array

0036-valid-sudoku
0042-trapping-rain-water
0055-jump-game
0150-evaluate-reverse-polish-notation
0179-largest-number
0239-sliding-window-maximum
0307-range-sum-query-mutable
0330-patching-array
0496-next-greater-element-i
0503-next-greater-element-ii
0539-minimum-time-difference
0624-maximum-distance-in-arrays
0632-smallest-range-covering-elements-from-k-lists
0729-my-calendar-i
0731-my-calendar-ii
0739-daily-temperatures
0797-rabbits-in-forest
0859-design-circular-deque
0860-design-circular-queue
0890-lemonade-change
0892-shortest-subarray-with-sum-at-least-k
0906-walking-robot-simulation
0926-find-and-replace-pattern
0943-sum-of-subarray-minimums
1002-maximum-width-ramp
1018-largest-perimeter-triangle
1095-two-city-scheduling
1147-flip-columns-for-maximum-number-of-equal-rows
1256-rank-transform-of-an-array
1325-path-with-maximum-probability
1350-remove-sub-folders-from-the-filesystem
1354-find-players-with-zero-or-one-losses
1402-count-square-submatrices-with-all-ones
1435-xor-queries-of-a-subarray
1497-design-a-stack-with-increment-operation
1570-final-prices-with-a-special-discount-in-a-shop
1620-check-if-array-pairs-are-divisible-by-k
1679-shortest-subarray-to-be-removed-to-make-array-sorted
1694-make-sum-divisible-by-p
1755-defuse-the-bomb
1766-minimum-number-of-removals-to-make-mountain-array
1917-maximum-average-pass-ratio
1923-sentence-similarity-iii
1940-maximum-xor-for-each-query
2006-find-the-student-that-will-replace-the-chalk
2054-the-number-of-the-smallest-unoccupied-chair
2089-maximum-matrix-sum
2132-convert-1d-array-into-2d-array
2155-find-missing-observations
2170-count-number-of-maximum-bitwise-or-subsets
2179-most-beautiful-item-for-each-query
2188-minimized-maximum-of-products-distributed-to-any-store
2195-time-needed-to-buy-tickets
2232-adding-spaces-to-a-string
2343-count-unguarded-cells-in-the-grid
2356-largest-combination-with-bitwise-and-greater-than-zero
2375-minimum-obstacle-removal-to-reach-corner
2411-spiral-matrix-iv
2450-minimum-replacements-to-sort-the-array
2488-divide-intervals-into-minimum-number-of-groups
2494-sum-of-prefix-scores-of-strings
2503-longest-subarray-with-maximum-bitwise-and
2545-height-of-binary-tree-after-subtree-removal-queries
2552-maximum-sum-of-distinct-subarrays-with-length-k
2554-minimum-total-distance-traveled
2581-divide-players-into-teams-of-equal-skill
2586-longest-square-streak-in-an-array
2616-maximal-score-after-applying-k-operations
2692-take-gifts-from-the-richest-pile
2716-prime-subtraction-operation
2755-extra-characters-in-a-string
2767-maximum-sum-with-exactly-k-elements
2794-maximum-number-of-moves-in-a-grid
3165-find-indices-with-index-and-value-difference-i
3291-find-if-array-can-be-sorted
3329-find-the-length-of-the-longest-common-prefix
3380-shortest-subarray-with-or-at-least-k-ii
3501-delete-nodes-from-linked-list-present-in-array
3555-final-array-state-after-k-multiplication-operations-i

Greedy

0055-jump-game
0179-largest-number
0330-patching-array
0624-maximum-distance-in-arrays
0632-smallest-range-covering-elements-from-k-lists
0649-dota2-senate
0670-maximum-swap
0768-partition-labels
0797-rabbits-in-forest
0890-lemonade-change
0957-minimum-add-to-make-parentheses-valid
1018-largest-perimeter-triangle
1095-two-city-scheduling
1304-longest-happy-string
1766-minimum-number-of-removals-to-make-mountain-array
1917-maximum-average-pass-ratio
2089-maximum-matrix-sum
2095-minimum-number-of-swaps-to-make-the-string-balanced
2450-minimum-replacements-to-sort-the-array
2488-divide-intervals-into-minimum-number-of-groups
2616-maximal-score-after-applying-k-operations
2715-k-items-with-the-maximum-sum
2716-prime-subtraction-operation
2767-maximum-sum-with-exactly-k-elements
3195-separate-black-and-white-balls

Hash Table

0003-longest-substring-without-repeating-characters
0036-valid-sudoku
0076-minimum-window-substring
0141-linked-list-cycle
0142-linked-list-cycle-ii
0146-lru-cache
0264-ugly-number-ii
0424-longest-repeating-character-replacement
0432-all-oone-data-structure
0496-next-greater-element-i
0567-permutation-in-string
0632-smallest-range-covering-elements-from-k-lists
0768-partition-labels
0797-rabbits-in-forest
0906-walking-robot-simulation
0920-uncommon-words-from-two-sentences
0926-find-and-replace-pattern
0984-most-stones-removed-with-same-row-or-column
1147-flip-columns-for-maximum-number-of-equal-rows
1256-rank-transform-of-an-array
1354-find-players-with-zero-or-one-losses
1620-check-if-array-pairs-are-divisible-by-k
1694-make-sum-divisible-by-p
1715-split-a-string-into-the-max-number-of-unique-substrings
2054-the-number-of-the-smallest-unoccupied-chair
2356-largest-combination-with-bitwise-and-greater-than-zero
2552-maximum-sum-of-distinct-subarrays-with-length-k
2581-divide-players-into-teams-of-equal-skill
2586-longest-square-streak-in-an-array
2599-take-k-of-each-character-from-left-and-right
2677-cousins-in-binary-tree-ii
2755-extra-characters-in-a-string
3329-find-the-length-of-the-longest-common-prefix
3501-delete-nodes-from-linked-list-present-in-array

Dynamic Programming

0042-trapping-rain-water
0055-jump-game
0062-unique-paths
0241-different-ways-to-add-parentheses
0264-ugly-number-ii
0803-cheapest-flights-within-k-stops
0943-sum-of-subarray-minimums
1013-fibonacci-number
1402-count-square-submatrices-with-all-ones
1456-find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance
1756-minimum-deletions-to-make-string-balanced
1766-minimum-number-of-removals-to-make-mountain-array
2187-vowels-of-all-substrings
2477-number-of-ways-to-reach-a-position-after-exactly-k-steps
2554-minimum-total-distance-traveled
2586-longest-square-streak-in-an-array
2755-extra-characters-in-a-string
2794-maximum-number-of-moves-in-a-grid

Heap (Priority Queue)

0239-sliding-window-maximum
0264-ugly-number-ii
0632-smallest-range-covering-elements-from-k-lists
0744-network-delay-time
0803-cheapest-flights-within-k-stops
0892-shortest-subarray-with-sum-at-least-k
1304-longest-happy-string
1325-path-with-maximum-probability
1917-maximum-average-pass-ratio
2054-the-number-of-the-smallest-unoccupied-chair
2375-minimum-obstacle-removal-to-reach-corner
2488-divide-intervals-into-minimum-number-of-groups
2616-maximal-score-after-applying-k-operations
2692-take-gifts-from-the-richest-pile
2803-modify-graph-edge-weights
3555-final-array-state-after-k-multiplication-operations-i

Union Find

0984-most-stones-removed-with-same-row-or-column

Graph

0744-network-delay-time
0803-cheapest-flights-within-k-stops
0984-most-stones-removed-with-same-row-or-column
1325-path-with-maximum-probability
1456-find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance
2375-minimum-obstacle-removal-to-reach-corner
2803-modify-graph-edge-weights
3189-find-champion-ii

Shortest Path

0744-network-delay-time
0803-cheapest-flights-within-k-stops
1325-path-with-maximum-probability
1456-find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance
2375-minimum-obstacle-removal-to-reach-corner
2803-modify-graph-edge-weights

Linked List

0019-remove-nth-node-from-end-of-list
0021-merge-two-sorted-lists
0083-remove-duplicates-from-sorted-list
0086-partition-list
0116-populating-next-right-pointers-in-each-node
0141-linked-list-cycle
0142-linked-list-cycle-ii
0146-lru-cache
0206-reverse-linked-list
0234-palindrome-linked-list
0237-delete-node-in-a-linked-list
0432-all-oone-data-structure
0725-split-linked-list-in-parts
0838-design-linked-list
0859-design-circular-deque
0860-design-circular-queue
0908-middle-of-the-linked-list
1484-linked-list-in-binary-tree
2299-merge-nodes-in-between-zeros
2411-spiral-matrix-iv
2903-insert-greatest-common-divisors-in-linked-list
3501-delete-nodes-from-linked-list-present-in-array

Design

0146-lru-cache
0155-min-stack
0307-range-sum-query-mutable
0432-all-oone-data-structure
0729-my-calendar-i
0731-my-calendar-ii
0838-design-linked-list
0859-design-circular-deque
0860-design-circular-queue
0969-number-of-recent-calls
1497-design-a-stack-with-increment-operation

Two Pointers

0019-remove-nth-node-from-end-of-list
0042-trapping-rain-water
0086-partition-list
0141-linked-list-cycle
0142-linked-list-cycle-ii
0234-palindrome-linked-list
0344-reverse-string
0567-permutation-in-string
0768-partition-labels
0908-middle-of-the-linked-list
1679-shortest-subarray-to-be-removed-to-make-array-sorted
1923-sentence-similarity-iii
2095-minimum-number-of-swaps-to-make-the-string-balanced
2232-adding-spaces-to-a-string
2488-divide-intervals-into-minimum-number-of-groups
2581-divide-players-into-teams-of-equal-skill
3165-find-indices-with-index-and-value-difference-i
3195-separate-black-and-white-balls

Matrix

0036-valid-sudoku
1147-flip-columns-for-maximum-number-of-equal-rows
1402-count-square-submatrices-with-all-ones
2089-maximum-matrix-sum
2132-convert-1d-array-into-2d-array
2343-count-unguarded-cells-in-the-grid
2375-minimum-obstacle-removal-to-reach-corner
2411-spiral-matrix-iv
2794-maximum-number-of-moves-in-a-grid

Binary Search

0278-first-bad-version
0729-my-calendar-i
0731-my-calendar-ii
0892-shortest-subarray-with-sum-at-least-k
1679-shortest-subarray-to-be-removed-to-make-array-sorted
1766-minimum-number-of-removals-to-make-mountain-array
2006-find-the-student-that-will-replace-the-chalk
2179-most-beautiful-item-for-each-query
2188-minimized-maximum-of-products-distributed-to-any-store
2586-longest-square-streak-in-an-array
2716-prime-subtraction-operation

Prefix Sum

0731-my-calendar-ii
0892-shortest-subarray-with-sum-at-least-k
1435-xor-queries-of-a-subarray
1694-make-sum-divisible-by-p
1940-maximum-xor-for-each-query
2006-find-the-student-that-will-replace-the-chalk
2488-divide-intervals-into-minimum-number-of-groups

Breadth-First Search

0116-populating-next-right-pointers-in-each-node
0199-binary-tree-right-side-view
0744-network-delay-time
0803-cheapest-flights-within-k-stops
1484-linked-list-in-binary-tree
2375-minimum-obstacle-removal-to-reach-corner
2545-height-of-binary-tree-after-subtree-removal-queries
2646-kth-largest-sum-in-a-binary-tree
2677-cousins-in-binary-tree-ii

Binary Tree

0110-balanced-binary-tree
0116-populating-next-right-pointers-in-each-node
0199-binary-tree-right-side-view
0988-flip-equivalent-binary-trees
1484-linked-list-in-binary-tree
2545-height-of-binary-tree-after-subtree-removal-queries
2646-kth-largest-sum-in-a-binary-tree
2677-cousins-in-binary-tree-ii

Number Theory

2716-prime-subtraction-operation
2903-insert-greatest-common-divisors-in-linked-list

Sorting

0179-largest-number
0539-minimum-time-difference
0632-smallest-range-covering-elements-from-k-lists
1018-largest-perimeter-triangle
1095-two-city-scheduling
1256-rank-transform-of-an-array
1354-find-players-with-zero-or-one-losses
2179-most-beautiful-item-for-each-query
2488-divide-intervals-into-minimum-number-of-groups
2554-minimum-total-distance-traveled
2581-divide-players-into-teams-of-equal-skill
2586-longest-square-streak-in-an-array
2646-kth-largest-sum-in-a-binary-tree
3291-find-if-array-can-be-sorted

Counting

0920-uncommon-words-from-two-sentences
1354-find-players-with-zero-or-one-losses
1620-check-if-array-pairs-are-divisible-by-k
2356-largest-combination-with-bitwise-and-greater-than-zero
2494-sum-of-prefix-scores-of-strings

Bit Manipulation

0342-power-of-four
1435-xor-queries-of-a-subarray
1940-maximum-xor-for-each-query
2170-count-number-of-maximum-bitwise-or-subsets
2323-minimum-bit-flips-to-convert-number
2356-largest-combination-with-bitwise-and-greater-than-zero
2503-longest-subarray-with-maximum-bitwise-and
3291-find-if-array-can-be-sorted
3380-shortest-subarray-with-or-at-least-k-ii
3394-minimum-array-end
3600-find-the-k-th-character-in-string-game-i

Brainteaser

2503-longest-subarray-with-maximum-bitwise-and

Recursion

0021-merge-two-sorted-lists
0050-powx-n
0206-reverse-linked-list
0234-palindrome-linked-list
0241-different-ways-to-add-parentheses
0342-power-of-four
1013-fibonacci-number
1197-parsing-a-boolean-expression
1667-find-kth-bit-in-nth-binary-string
2050-count-good-numbers
3600-find-the-k-th-character-in-string-game-i

Memoization

0241-different-ways-to-add-parentheses
1013-fibonacci-number

Rolling Hash

0214-shortest-palindrome

String Matching

0214-shortest-palindrome
0812-rotate-string

Hash Function

0214-shortest-palindrome

Trie

0386-lexicographical-numbers
0440-k-th-smallest-in-lexicographical-order
1350-remove-sub-folders-from-the-filesystem
2494-sum-of-prefix-scores-of-strings
2755-extra-characters-in-a-string
3329-find-the-length-of-the-longest-common-prefix

Segment Tree

0307-range-sum-query-mutable
0729-my-calendar-i
0731-my-calendar-ii

Ordered Set

0729-my-calendar-i
0731-my-calendar-ii

Queue

0239-sliding-window-maximum
0649-dota2-senate
0859-design-circular-deque
0860-design-circular-queue
0892-shortest-subarray-with-sum-at-least-k
0969-number-of-recent-calls
2195-time-needed-to-buy-tickets

Doubly-Linked List

0146-lru-cache
0432-all-oone-data-structure

Sliding Window

0003-longest-substring-without-repeating-characters
0076-minimum-window-substring
0239-sliding-window-maximum
0424-longest-repeating-character-replacement
0567-permutation-in-string
0632-smallest-range-covering-elements-from-k-lists
0892-shortest-subarray-with-sum-at-least-k
1755-defuse-the-bomb
2552-maximum-sum-of-distinct-subarrays-with-length-k
2599-take-k-of-each-character-from-left-and-right
3380-shortest-subarray-with-or-at-least-k-ii

Monotonic Stack

0042-trapping-rain-water
0496-next-greater-element-i
0503-next-greater-element-ii
0739-daily-temperatures
0943-sum-of-subarray-minimums
1002-maximum-width-ramp
1570-final-prices-with-a-special-discount-in-a-shop
1679-shortest-subarray-to-be-removed-to-make-array-sorted

Backtracking

1715-split-a-string-into-the-max-number-of-unique-substrings
2170-count-number-of-maximum-bitwise-or-subsets

Enumeration

2170-count-number-of-maximum-bitwise-or-subsets

Combinatorics

0062-unique-paths
2187-vowels-of-all-substrings
2477-number-of-ways-to-reach-a-position-after-exactly-k-steps

Binary Indexed Tree

0307-range-sum-query-mutable

Interactive

0278-first-bad-version

Monotonic Queue

0239-sliding-window-maximum
0892-shortest-subarray-with-sum-at-least-k

Data Stream

0969-number-of-recent-calls

About

This repo tracks my solutions to DSA problems.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages