Collection of tips and tricks for coding interview and competitive coding problems .
- https://leetcode.com/problems/minimum-window-substring/discuss/26808/here-is-a-10-line-template-that-can-solve-most-substring-problems
- https://leetcode.com/problems/two-sum/
- https://leetcode.com/problems/best-time-to-buy-and-sell-stock/
Learn:
1.Basics of STL = https://www.youtube.com/playlist?list=PL_dsdStdDXbq8BTjGdUEWgWYFWYP6pwYb
- https://leetcode.com/problems/contains-duplicate/ (sort and check adjacent elements (gives runtime error))
- Product of Array Except Self: https://leetcode.com/problems/product-of-array-except-self/
Learn:
- How to Pass by reference(C++) : https://www.ibm.com/support/knowledgecenter/en/SSLTBW_2.3.0/com.ibm.zos.v2r3.cbclx01/cplr233.htm
- C++ STL: Set : https://www.geeksforgeeks.org/set-in-cpp-stl/
6.https://leetcode.com/problems/maximum-subarray/
Learn:
Learn:
- https://leetcode.com/problems/remove-duplicates-from-sorted-array/
- https://leetcode.com/problems/remove-duplicates-from-sorted-list/submissions/
- https://leetcode.com/problems/linked-list-cycle/
- https://leetcode.com/problems/intersection-of-two-linked-lists/
- https://leetcode.com/problems/middle-of-the-linked-list/
- https://leetcode.com/problems/reverse-linked-list/submissions/
Learn: Java Multithreading.
Learnt and Implemented Segment Tree: https://cp-algorithms.com/data_structures/segment_tree.html
- https://leetcode.com/problems/min-cost-climbing-stairs/submissions/
- https://leetcode.com/problems/defanging-an-ip-address/submissions/
- https://leetcode.com/problems/sort-array-by-parity/
- https://leetcode.com/problems/find-all-numbers-disappeared-in-an-array/
- https://leetcode.com/problems/squares-of-a-sorted-array/
- https://leetcode.com/problems/fibonacci-number/
Learnt and implemented: BFS and DFS.
- https://leetcode.com/problems/duplicate-zeros/
- https://leetcode.com/problems/unique-morse-code-words/
https://leetcode.com/problems/divisor-game/
- https://leetcode.com/problems/is-subsequence/submissions/
- https://leetcode.com/problems/climbing-stairs/
- https://leetcode.com/problems/range-sum-query-immutable/
- https://leetcode.com/problems/distribute-candies-to-people/
- https://leetcode.com/problems/complement-of-base-10-integer/
- https://leetcode.com/problems/largest-perimeter-triangle/
- https://leetcode.com/problems/valid-mountain-array/
- https://leetcode.com/problems/shortest-unsorted-continuous-subarray/
- https://leetcode.com/problems/find-first-and-last-position-of-element-in-sorted-array/
- https://leetcode.com/problems/number-of-steps-to-reduce-a-number-to-zero/
When we copy contents of one variable to other simply by assigning in python, we create an Alias, not a separate copy. https://www.geeksforgeeks.org/copy-python-deep-copy-shallow-copy/
- https://leetcode.com/problems/verifying-an-alien-dictionary/
- https://www.hackerrank.com/challenges/find-digits/problem
- https://www.hackerrank.com/challenges/cut-the-sticks/problem
- https://leetcode.com/problems/assign-cookies/
- https://www.hackerrank.com/challenges/luck-balance/problem
- https://www.hackerrank.com/challenges/permutation-equation/problem
- In Python 3, False == 0 evaluates to True.
- Sorting a List of List by specific index. :- https://www.geeksforgeeks.org/python-sort-list-of-list-by-specified-index/
- sizeof() equivalent of C in Python:- :- step 1: import sys step 2: sys.getsizeof(object)
- https://leetcode.com/problems/validate-binary-search-tree/
- https://leetcode.com/problems/add-strings/
- https://leetcode.com/problems/count-square-submatrices-with-all-ones/
- https://www.hackerrank.com/challenges/finding-the-percentage/problem?isFullScreen=false
- https://www.hackerrank.com/challenges/find-second-maximum-number-in-a-list/problem
- https://www.hackerrank.com/challenges/alphabet-rangoli/problem
- https://www.hackerrank.com/challenges/list-comprehensions/problem
- https://www.hackerrank.com/challenges/find-a-string/problem https://www.geeksforgeeks.org/kmp-algorithm-for-pattern-searching/
-
https://leetcode.com/problems/hand-of-straights/ Solution: https://leetcode.com/problems/hand-of-straights/discuss/354105/Fully-Explained-Python-Solution
-
https://leetcode.com/problems/average-of-levels-in-binary-tree/
- https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-search-tree/
- https://leetcode.com/problems/binary-tree-paths/
- https://leetcode.com/problems/min-stack/
- https://leetcode.com/problems/monotonic-array/
- https://leetcode.com/problems/maximum-depth-of-n-ary-tree/
- https://leetcode.com/problems/reshape-the-matrix/
- https://leetcode.com/problems/maximum-number-of-balloons/
- https://leetcode.com/problems/minimum-absolute-difference/
- https://leetcode.com/problems/unique-number-of-occurrences/
- https://leetcode.com/problems/degree-of-an-array/
- https://leetcode.com/problems/flood-fill/
- https://leetcode.com/problems/valid-anagram/
- https://leetcode.com/problems/third-maximum-number/
- https://leetcode.com/problems/plus-one/
- https://leetcode.com/problems/add-binary/ : How to handle large number divisions
- https://leetcode.com/problems/valid-parentheses/
- https://leetcode.com/problems/word-pattern/
- https://leetcode.com/problems/longest-common-prefix/
- https://leetcode.com/problems/remove-linked-list-elements/
- https://leetcode.com/problems/sum-of-even-numbers-after-queries/(earlier solved in python, now in Java)
- https://leetcode.com/problems/longest-palindrome/
- https://www.hackerrank.com/challenges/picking-numbers/problem
- https://leetcode.com/problems/number-of-lines-to-write-string/
- https://leetcode.com/problems/find-pivot-index/
- https://leetcode.com/problems/smallest-range-i/
- https://leetcode.com/problems/subtree-of-another-tree/
- https://leetcode.com/problems/asteroid-collision/
- https://www.hackerrank.com/challenges/strange-advertising/problem
- https://www.hackerrank.com/challenges/append-and-delete/problem
- https://www.hackerrank.com/challenges/library-fine/problem
- https://www.hackerrank.com/challenges/repeated-string/problem
- https://www.hackerrank.com/challenges/equality-in-a-array/problem
- https://www.hackerrank.com/challenges/string-validators/problem
- https://www.hackerrank.com/challenges/text-alignment/problem
- https://www.hackerrank.com/challenges/python-string-formatting/problem
- https://www.hackerrank.com/challenges/merge-the-tools/problem
- https://leetcode.com/problems/add-two-numbers/
- https://leetcode.com/problems/longest-substring-without-repeating-characters/
- https://leetcode.com/problems/find-the-index-of-the-first-occurrence-in-a-string/submissions/919373474/
- https://leetcode.com/problems/length-of-last-word/
- https://leetcode.com/problems/valid-palindrome/description/
- https://leetcode.com/problems/single-number/description/
- https://leetcode.com/problems/majority-element/description/
- https://leetcode.com/problems/excel-sheet-column-number/description/
- https://leetcode.com/problems/number-of-1-bits/description/
- https://leetcode.com/problems/happy-number/description/
- https://leetcode.com/problems/isomorphic-strings/description/
- https://leetcode.com/problems/first-unique-character-in-a-string/description/
- https://leetcode.com/problems/power-of-two/description/
- https://leetcode.com/problems/arranging-coins/description/
- https://leetcode.com/problems/find-n-unique-integers-sum-up-to-zero/description/
- https://leetcode.com/problems/longest-palindromic-substring/description/
- https://leetcode.com/problems/palindrome-number/description/