An open API service indexing awesome lists of open source software.

https://github.com/akankshakumari393/leetcode

Leetcode solutions(Golang) Actively updating
https://github.com/akankshakumari393/leetcode

algorithms data-structures go golang interview-practice leetcode leetcode-solutions

Last synced: 5 months ago
JSON representation

Leetcode solutions(Golang) Actively updating

Awesome Lists containing this project

README

        

## REAL LIFE USAGE FOR DATASTRUCTURE

**Array**:
Seat of a Theatre represents an 2D array

**StacK**:

The browser history is stored in stack usually so we can go back to the last visited pages.

**Singly Linked List**:

In a music player, songs are connected, we play one song then we get the other song in the playlist automatically, that's because the songs are connected and we can consider them as nodes.

**Doubly Linked List**:

Sometime we would like to go back to the previous song played so that's where doubly Linked list comes in picture. From each of the song we can either go back or play the next song. .

**Circular Linked List**:

Sometime we would like the playlist to play the first song again once it finishes playing all or in simple terms repeat itself. That's where Circular linked list comes in picture.

**Graph**:

Google Map uses graph, each cities(nodes) are connected with some edges(path) that have some weight(distance). Google map uses graph algorithm to find the shortest path between two cities.

**BST(Binary Search Tree)**:

It would take at worst n element to insert/delete an element from a sorted array. So we represent it using BST. So searching and Retrieval is mostly done using BST.

# leetcode
Leetcode solutions(Golang)

[1-two-sum](https://github.com/akankshakumari393/leetcode/tree/master/1-two-sum) \
[2-add-two-numbers](https://github.com/akankshakumari393/leetcode/tree/master/2-add-two-numbers) \
[3-longest-substring-without-repeating-characters](https://github.com/akankshakumari393/leetcode/tree/master/3-longest-substring-without-repeating-characters) \
[4-median-of-two-sorted-arrays](https://github.com/akankshakumari393/leetcode/tree/master/4-median-of-two-sorted-arrays) \
[5-longest-palindromic-substring](https://github.com/akankshakumari393/leetcode/tree/master/5-longest-palindromic-substring) \
[8-string-to-integer-atoi](https://github.com/akankshakumari393/leetcode/tree/master/8-string-to-integer-atoi) \
[9-palindrome-number](https://github.com/akankshakumari393/leetcode/tree/master/9-palindrome-number) \
[11-container-with-most-water](https://github.com/akankshakumari393/leetcode/tree/master/11-container-with-most-water) \
[12-integer-to-roman](https://github.com/akankshakumari393/leetcode/tree/master/12-integer-to-roman) \
[13-roman-to-integer](https://github.com/akankshakumari393/leetcode/tree/master/13-roman-to-integer) \
[14-longest-common-prefix](https://github.com/akankshakumari393/leetcode/tree/master/14-longest-common-prefix) \
[15-3sum](https://github.com/akankshakumari393/leetcode/tree/master/15-3sum) \
[19-remove-nth-node-from-end-of-list](https://github.com/akankshakumari393/leetcode/tree/master/19-remove-nth-node-from-end-of-list) \
[20-valid-parentheses](https://github.com/akankshakumari393/leetcode/tree/master/20-valid-parentheses) \
[21-merge-two-sorted-lists](https://github.com/akankshakumari393/leetcode/tree/master/21-merge-two-sorted-lists) \
[26-remove-duplicates-from-sorted-array](https://github.com/akankshakumari393/leetcode/tree/master/26-remove-duplicates-from-sorted-array) \
[27-remove-element](https://github.com/akankshakumari393/leetcode/tree/master/27-remove-element) \
[31-next-permutation](https://github.com/akankshakumari393/leetcode/tree/master/31-next-permutation) \
[33-search-in-rotated-sorted-array](https://github.com/akankshakumari393/leetcode/tree/master/33-search-in-rotated-sorted-array) \
[34-find-first-and-last-position-of-element-in-sorted-array](https://github.com/akankshakumari393/leetcode/tree/master/34-find-first-and-last-position-of-element-in-sorted-array) \
[35-search-insert-position](https://github.com/akankshakumari393/leetcode/tree/master/35-search-insert-position) \
[36-valid-sudoku](https://github.com/akankshakumari393/leetcode/tree/master/36-valid-sudoku) \
[39-combination-sum](https://github.com/akankshakumari393/leetcode/tree/master/39-combination-sum) \
[46-permutations](https://github.com/akankshakumari393/leetcode/tree/master/46-permutations) \
[48-rotate-image](https://github.com/akankshakumari393/leetcode/tree/master/48-rotate-image) \
[49-group-anagrams](https://github.com/akankshakumari393/leetcode/tree/master/49-group-anagrams) \
[50-powx-n](https://github.com/akankshakumari393/leetcode/tree/master/50-powx-n) \
[53-maximum-subarray](https://github.com/akankshakumari393/leetcode/tree/master/53-maximum-subarray) \
[56-merge-intervals](https://github.com/akankshakumari393/leetcode/tree/master/56-merge-intervals) \
[58-length-of-last-word](https://github.com/akankshakumari393/leetcode/tree/master/58-length-of-last-word) \
[61-rotate-list](https://github.com/akankshakumari393/leetcode/tree/master/61-rotate-list) \
[62-unique-paths](https://github.com/akankshakumari393/leetcode/tree/master/62-unique-paths) \
[64-minimum-path-sum](https://github.com/akankshakumari393/leetcode/tree/master/64-minimum-path-sum) \
[66-plus-one](https://github.com/akankshakumari393/leetcode/tree/master/66-plus-one) \
[69-sqrtx](https://github.com/akankshakumari393/leetcode/tree/master/69-sqrtx) \
[70-climbing-stairs](https://github.com/akankshakumari393/leetcode/tree/master/70-climbing-stairs) \
[73-set-matrix-zeroes](https://github.com/akankshakumari393/leetcode/tree/master/73-set-matrix-zeroes) \
[74-search-a-2d-matrix](https://github.com/akankshakumari393/leetcode/tree/master/74-search-a-2d-matrix) \
[75-sort-colors](https://github.com/akankshakumari393/leetcode/tree/master/75-sort-colors) \
[77-combinations](https://github.com/akankshakumari393/leetcode/tree/master/77-combinations) \
[81-search-in-rotated-sorted-array-ii](https://github.com/akankshakumari393/leetcode/tree/master/81-search-in-rotated-sorted-array-ii) \
[83-remove-duplicates-from-sorted-list](https://github.com/akankshakumari393/leetcode/tree/master/83-remove-duplicates-from-sorted-list) \
[88-merge-sorted-array](https://github.com/akankshakumari393/leetcode/tree/master/88-merge-sorted-array) \
[92-reverse-linked-list-ii](https://github.com/akankshakumari393/leetcode/tree/master/92-reverse-linked-list-ii) \
[94-binary-tree-inorder-traversal](https://github.com/akankshakumari393/leetcode/tree/master/94-binary-tree-inorder-traversal) \
[98-validate-binary-search-tree](https://github.com/akankshakumari393/leetcode/tree/master/98-validate-binary-search-tree) \
[100-same-tree](https://github.com/akankshakumari393/leetcode/tree/master/100-same-tree) \
[101-symmetric-tree](https://github.com/akankshakumari393/leetcode/tree/master/101-symmetric-tree) \
[102-binary-tree-level-order-traversal](https://github.com/akankshakumari393/leetcode/tree/master/102-binary-tree-level-order-traversal) \
[104-maximum-depth-of-binary-tree](https://github.com/akankshakumari393/leetcode/tree/master/104-maximum-depth-of-binary-tree) \
[105-construct-binary-tree-from-preorder-and-inorder-traversal](https://github.com/akankshakumari393/leetcode/tree/master/105-construct-binary-tree-from-preorder-and-inorder-traversal) \
[106-construct-binary-tree-from-inorder-and-postorder-traversal](https://github.com/akankshakumari393/leetcode/tree/master/106-construct-binary-tree-from-inorder-and-postorder-traversal) \
[108-convert-sorted-array-to-binary-search-tree](https://github.com/akankshakumari393/leetcode/tree/master/108-convert-sorted-array-to-binary-search-tree) \
[111-minimum-depth-of-binary-tree](https://github.com/akankshakumari393/leetcode/tree/master/111-minimum-depth-of-binary-tree) \
[118-pascals-triangle](https://github.com/akankshakumari393/leetcode/tree/master/118-pascals-triangle) \
[119-pascals-triangle-ii](https://github.com/akankshakumari393/leetcode/tree/master/119-pascals-triangle-ii) \
[121-best-time-to-buy-and-sell-stock](https://github.com/akankshakumari393/leetcode/tree/master/121-best-time-to-buy-and-sell-stock) \
[125-valid-palindrome](https://github.com/akankshakumari393/leetcode/tree/master/125-valid-palindrome) \
[128-longest-consecutive-sequence](https://github.com/akankshakumari393/leetcode/tree/master/128-longest-consecutive-sequence) \
[130-surrounded-regions](https://github.com/akankshakumari393/leetcode/tree/master/130-surrounded-regions) \
[133-clone-graph](https://github.com/akankshakumari393/leetcode/tree/master/133-clone-graph) \
[136-single-number](https://github.com/akankshakumari393/leetcode/tree/master/136-single-number) \
[138-copy-list-with-random-pointer](https://github.com/akankshakumari393/leetcode/tree/master/138-copy-list-with-random-pointer) \
[141-linked-list-cycle](https://github.com/akankshakumari393/leetcode/tree/master/141-linked-list-cycle) \
[142-linked-list-cycle-ii](https://github.com/akankshakumari393/leetcode/tree/master/142-linked-list-cycle-ii) \
[144-binary-tree-preorder-traversal](https://github.com/akankshakumari393/leetcode/tree/master/144-binary-tree-preorder-traversal) \
[145-binary-tree-postorder-traversal](https://github.com/akankshakumari393/leetcode/tree/master/145-binary-tree-postorder-traversal) \
[153-find-minimum-in-rotated-sorted-array](https://github.com/akankshakumari393/leetcode/tree/master/153-find-minimum-in-rotated-sorted-array) \
[160-intersection-of-two-linked-lists](https://github.com/akankshakumari393/leetcode/tree/master/160-intersection-of-two-linked-lists) \
[162-find-peak-element](https://github.com/akankshakumari393/leetcode/tree/master/162-find-peak-element) \
[169-majority-element](https://github.com/akankshakumari393/leetcode/tree/master/169-majority-element) \
[199-binary-tree-right-side-view](https://github.com/akankshakumari393/leetcode/tree/master/199-binary-tree-right-side-view) \
[200-number-of-islands](https://github.com/akankshakumari393/leetcode/tree/master/200-number-of-islands) \
[203-remove-linked-list-elements](https://github.com/akankshakumari393/leetcode/tree/master/203-remove-linked-list-elements) \
[206-reverse-linked-list](https://github.com/akankshakumari393/leetcode/tree/master/206-reverse-linked-list) \
[207-course-schedule](https://github.com/akankshakumari393/leetcode/tree/master/207-course-schedule) \
[210-course-schedule-ii](https://github.com/akankshakumari393/leetcode/tree/master/210-course-schedule-ii) \
[217-contains-duplicate](https://github.com/akankshakumari393/leetcode/tree/master/217-contains-duplicate) \
[219-contains-duplicate-ii](https://github.com/akankshakumari393/leetcode/tree/master/219-contains-duplicate-ii) \
[226-invert-binary-tree](https://github.com/akankshakumari393/leetcode/tree/master/226-invert-binary-tree) \
[229-majority-element-ii](https://github.com/akankshakumari393/leetcode/tree/master/229-majority-element-ii) \
[234-palindrome-linked-list](https://github.com/akankshakumari393/leetcode/tree/master/234-palindrome-linked-list) \
[235-lowest-common-ancestor-of-a-binary-search-tree](https://github.com/akankshakumari393/leetcode/tree/master/235-lowest-common-ancestor-of-a-binary-search-tree) \
[240-search-a-2d-matrix-ii](https://github.com/akankshakumari393/leetcode/tree/master/240-search-a-2d-matrix-ii) \
[242-valid-anagram](https://github.com/akankshakumari393/leetcode/tree/master/242-valid-anagram)
[278-first-bad-version](https://github.com/akankshakumari393/leetcode/tree/master/278-first-bad-version) \
[287-find-the-duplicate-number](https://github.com/akankshakumari393/leetcode/tree/master/287-find-the-duplicate-number) \
[289-game-of-life](https://github.com/akankshakumari393/leetcode/tree/master/289-game-of-life) \
[300-longest-increasing-subsequence](https://github.com/akankshakumari393/leetcode/tree/master/300-longest-increasing-subsequence) \
[328-odd-even-linked-list](https://github.com/akankshakumari393/leetcode/tree/master/328-odd-even-linked-list) \
[344-reverse-string](https://github.com/akankshakumari393/leetcode/tree/master/344-reverse-string) \
[350-intersection-of-two-arrays-ii](https://github.com/akankshakumari393/leetcode/tree/master/350-intersection-of-two-arrays-ii) \
[387-first-unique-character-in-a-string](https://github.com/akankshakumari393/leetcode/tree/master/387-first-unique-character-in-a-string) \
[410-split-array-largest-sum](https://github.com/akankshakumari393/leetcode/tree/master/410-split-array-largest-sum) \
[461-hamming-distance](https://github.com/akankshakumari393/leetcode/tree/master/461-hamming-distance) \
[520-detect-capital](https://github.com/akankshakumari393/leetcode/tree/master/520-detect-capital) \
[540-single-element-in-a-sorted-array](https://github.com/akankshakumari393/leetcode/tree/master/540-single-element-in-a-sorted-array) \
[543-diameter-of-binary-tree](https://github.com/akankshakumari393/leetcode/tree/master/543-diameter-of-binary-tree) \
[559-maximum-depth-of-n-ary-tree](https://github.com/akankshakumari393/leetcode/tree/master/559-maximum-depth-of-n-ary-tree) \
[566-reshape-the-matrix](https://github.com/akankshakumari393/leetcode/tree/master/566-reshape-the-matrix) \
[576-out-of-boundary-paths](https://github.com/akankshakumari393/leetcode/tree/master/576-out-of-boundary-paths) \
[680-valid-palindrome-ii](https://github.com/akankshakumari393/leetcode/tree/master/680-valid-palindrome-ii) \
[637-average-of-levels-in-binary-tree](https://github.com/akankshakumari393/leetcode/tree/master/637-average-of-levels-in-binary-tree) \
[695-max-area-of-island](https://github.com/akankshakumari393/leetcode/tree/master/695-max-area-of-island) \
[704-binary-search](https://github.com/akankshakumari393/leetcode/tree/master/704-binary-search) \
[705-design-hashset](https://github.com/akankshakumari393/leetcode/tree/master/705-design-hashset) \
[729-my-calendar-i](https://github.com/akankshakumari393/leetcode/tree/master/729-my-calendar-i) \
[746-min-cost-climbing-stairs](https://github.com/akankshakumari393/leetcode/tree/master/746-min-cost-climbing-stairs) \
[792-number-of-matching-subsequences](https://github.com/akankshakumari393/leetcode/tree/master/792-number-of-matching-subsequences) \
[804-unique-morse-code-words](https://github.com/akankshakumari393/leetcode/tree/master/804-unique-morse-code-words) \
[858-mirror-reflection](https://github.com/akankshakumari393/leetcode/tree/master/858-mirror-reflection) \
[875-koko-eating-bananas](https://github.com/akankshakumari393/leetcode/tree/master/875-koko-eating-bananas) \
[876-middle-of-the-linked-list](https://github.com/akankshakumari393/leetcode/tree/master/876-middle-of-the-linked-list) \
[890-find-and-replace-pattern](https://github.com/akankshakumari393/leetcode/tree/master/890-find-and-replace-pattern) \
[895-maximum-frequency-stack](https://github.com/akankshakumari393/leetcode/tree/master/895-maximum-frequency-stack) \
[997-find-the-town-judge](https://github.com/akankshakumari393/leetcode/tree/master/997-find-the-town-judge) \
[1011-capacity-to-ship-packages-within-d-days](https://github.com/akankshakumari393/leetcode/tree/master/1011-capacity-to-ship-packages-within-d-days) \
[1283-find-the-smallest-divisor-given-a-threshold](https://github.com/akankshakumari393/leetcode/tree/master/1283-find-the-smallest-divisor-given-a-threshold) \
[1329-sort-the-matrix-diagonally](https://github.com/akankshakumari393/leetcode/tree/master/1329-sort-the-matrix-diagonally) \
[1448-count-good-nodes-in-binary-tree](https://github.com/akankshakumari393/leetcode/tree/master/1448-count-good-nodes-in-binary-tree) \
[1482-minimum-number-of-days-to-make-m-bouquets](https://github.com/akankshakumari393/leetcode/tree/master/1482-minimum-number-of-days-to-make-m-bouquets) \
[1539-kth-missing-positive-number](https://github.com/akankshakumari393/leetcode/tree/master/1539-kth-missing-positive-number) \
[1603-design-parking-system](https://github.com/akankshakumari393/leetcode/tree/master/1603-design-parking-system) \
[1791-find-center-of-star-graph](https://github.com/akankshakumari393/leetcode/tree/master/1791-find-center-of-star-graph) \
[2013-detect-squares](https://github.com/akankshakumari393/leetcode/tree/master/2013-detect-squares) \
[2296-design-a-text-editor](https://github.com/akankshakumari393/leetcode/tree/master/2296-design-a-text-editor) \
[2351-first-letter-to-appear-twice](https://github.com/akankshakumari393/leetcode/tree/master/2351-first-letter-to-appear-twice)