All Projects โ†’ wuduhren โ†’ Leetcode Python

wuduhren / Leetcode Python

Licence: other
Leetcode Python Solution and Explanation. Also a Guide to Prepare for Software Engineer Interview.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Leetcode Python

Leetcode
๐Ÿ˜– ๐Ÿ˜• ๐Ÿ˜ƒLeetCode้—ฎ้ข˜่งฃ้ข˜ๆ€่ทฏใ€‚
Stars: โœญ 130 (-88.05%)
Mutual labels:  algorithms, data-structures, interview, leetcode
Interviewguide
ใ€ŠๅคงๅŽ‚้ข่ฏ•ๆŒ‡ๅŒ—ใ€‹โ€”โ€”ๅŒ…ๆ‹ฌJavaๅŸบ็ก€ใ€JVMใ€ๆ•ฐๆฎๅบ“ใ€mysqlใ€redisใ€่ฎก็ฎ—ๆœบ็ฝ‘็ปœใ€็ฎ—ๆณ•ใ€ๆ•ฐๆฎ็ป“ๆž„ใ€ๆ“ไฝœ็ณป็ปŸใ€่ฎพ่ฎกๆจกๅผใ€็ณป็ปŸ่ฎพ่ฎกใ€ๆก†ๆžถๅŽŸ็†ใ€‚ๆœ€ไฝณ้˜…่ฏปๅœฐๅ€๏ผšhttp://notfound9.github.io/interviewGuide/
Stars: โœญ 3,117 (+186.49%)
Mutual labels:  algorithms, data-structures, interview, leetcode
Leetcode 101
LeetCode 101๏ผšๅ’Œไฝ ไธ€่ตทไฝ ่ฝปๆพๅˆท้ข˜๏ผˆC++๏ผ‰
Stars: โœญ 5,327 (+389.61%)
Mutual labels:  algorithms, data-structures, interview, leetcode
Coding Problems
Solutions for various coding/algorithmic problems and many useful resources for learning algorithms and data structures
Stars: โœญ 2,221 (+104.14%)
Mutual labels:  algorithms, data-structures, interview, leetcode
Fuck Coding Interviews
How on earth can I ever think of a solution like that in an interview?!
Stars: โœญ 464 (-57.35%)
Mutual labels:  algorithms, data-structures, interview, leetcode
Algorithms Leetcode Javascript
Algorithms resolution in Javascript. Leetcode - Geeksforgeeks - Careercup
Stars: โœญ 157 (-85.57%)
Mutual labels:  algorithms, data-structures, interview, leetcode
Leetcode In Swift
My solutions to LeetCode problems written in Swift
Stars: โœญ 150 (-86.21%)
Mutual labels:  algorithms, data-structures, interview, leetcode
Algorithms And Data Structures In Java
Algorithms and Data Structures in Java
Stars: โœญ 498 (-54.23%)
Mutual labels:  algorithms, data-structures, interview, leetcode
Interviews
Everything you need to know to get the job.
Stars: โœญ 54,875 (+4943.66%)
Mutual labels:  algorithms, interview, leetcode
Fucking Algorithm
ๅˆท็ฎ—ๆณ•ๅ…จ้ ๅฅ—่ทฏ๏ผŒ่ฎคๅ‡† labuladong ๅฐฑๅคŸไบ†๏ผEnglish version supported! Crack LeetCode, not only how, but also why.
Stars: โœญ 99,705 (+9064.06%)
Mutual labels:  algorithms, data-structures, leetcode
Coding Interview University
A complete computer science study plan to become a software engineer.
Stars: โœญ 204,859 (+18728.95%)
Mutual labels:  algorithms, data-structures, interview
Interview Techdev Guide
This repository contains curated technical interview questions by fn+geeks community
Stars: โœญ 252 (-76.84%)
Mutual labels:  algorithms, data-structures, interview
Leetcodesolutions
Theoretical solutions for LeetCode problems.
Stars: โœญ 205 (-81.16%)
Mutual labels:  algorithms, data-structures, leetcode
Javascript Algorithms
๐Ÿ“ Algorithms and data structures implemented in JavaScript with explanations and links to further readings
Stars: โœญ 133,406 (+12161.58%)
Mutual labels:  algorithms, data-structures, interview
Awesome Coding Interview Question Patterns
The most common question-patterns for any coding-interview
Stars: โœญ 196 (-81.99%)
Mutual labels:  algorithms, data-structures, interview
Interview
๐Ÿ“š C/C++ ๆŠ€ๆœฏ้ข่ฏ•ๅŸบ็ก€็Ÿฅ่ฏ†ๆ€ป็ป“๏ผŒๅŒ…ๆ‹ฌ่ฏญ่จ€ใ€็จ‹ๅบๅบ“ใ€ๆ•ฐๆฎ็ป“ๆž„ใ€็ฎ—ๆณ•ใ€็ณป็ปŸใ€็ฝ‘็ปœใ€้“พๆŽฅ่ฃ…่ฝฝๅบ“็ญ‰็Ÿฅ่ฏ†ๅŠ้ข่ฏ•็ป้ชŒใ€ๆ‹›่˜ใ€ๅ†…ๆŽจ็ญ‰ไฟกๆฏใ€‚This repository is a summary of the basic knowledge of recruiting job seekers and beginners in the direction of C/C++ technology, including language, program library, data structure, algorithm, system, network, link loading library, interview experience, recruitment, recommendatioโ€ฆ
Stars: โœญ 21,608 (+1886.03%)
Mutual labels:  data-structures, interview, leetcode
Mega Interview Guide
The MEGA interview guide, JavaSciript, Front End, Comp Sci
Stars: โœญ 255 (-76.56%)
Mutual labels:  algorithms, data-structures, interview
Interview
Data Structures and Algorithms in Java (useful in interview process)
Stars: โœญ 396 (-63.6%)
Mutual labels:  algorithms, data-structures, interview
Ruby
All algorithms implemented in Ruby
Stars: โœญ 454 (-58.27%)
Mutual labels:  algorithms, data-structures, interview
Ready For Tech Interview
๐Ÿ’ป ์‹ ์ž… ๊ฐœ๋ฐœ์ž๋กœ์„œ ์ค€๋น„๋ฅผ ํ•˜๊ธฐ ์œ„ํ•ด ์ง€์‹์„ ์ •๋ฆฌํ•˜๋Š” ๊ณต๊ฐ„ ๐Ÿ‘จโ€๐Ÿ’ป
Stars: โœญ 1,035 (-4.87%)
Mutual labels:  algorithms, data-structures, interview

Overview

  1. This is my Python (2.7) Leetcode solution. As time grows, this also become a guide to prepare for software engineer interview.

  2. I really take time tried to make the best solution and collect the best resource that I found.
    Because I wanted to help others like me. If you like my answer, a star on GitHub means a lot to me. https://github.com/wuduhren/leetcode-python

  3. The solution is at problems/the-file-name/. For example, merge-sorted-array.py's solution is at https://leetcode.com/problems/merge-sorted-array/.

Leetcode Similar Problems

I found it makes sense to solve similar problems together, so that we can recognize the problem faster when we encounter a new one. My suggestion is to skip the HARD problems when you first go through these list.

Two Pointers

Id Name Difficulty Comments
11 Container With Most Water โ˜…โ˜…
167 Two Sum II - Input array is sorted โ˜…โ˜…
977 Squares of a Sorted Array โ˜…โ˜… merge sort

Recursion

Id Name Difficulty
726 Number of Atoms โ˜…โ˜…โ˜… 736 394
856 Score of Parentheses โ˜…โ˜…โ˜…

Divide and Conquer

Id Name Difficulty Comments
169 Majority Element โ˜…โ˜…
315 Count of Smaller Numbers After Self โ˜…โ˜…โ˜…โ˜… merge sort / BIT

Search

Id Name Difficulty Comments
17 Letter Combinations of a Phone Number โ˜…โ˜… 39 40 77 78 90 216 Combination
46 Permutations โ˜…โ˜… 47 784 943 996 Permutation
22 Generate Parentheses โ˜…โ˜…โ˜… 301 DFS
37 Sudoku Solver โ˜…โ˜…โ˜… 51 52 DFS
79 Word Search โ˜…โ˜…โ˜… 212 DFS
127 Word Ladder โ˜…โ˜…โ˜…โ˜… 126 752 BFS
542 01 Matrix โ˜…โ˜…โ˜… 675 934 BFS
698 Partition to K Equal Sum Subsets โ˜…โ˜…โ˜… 93 131 241 282 842 Partition

Hash Table

Id Name Difficulty
1 Two Sum โ˜…โ˜… 560

List

Id Name Difficulty Comments
2 Add Two Numbers โ˜…โ˜… 445
24 Swap Nodes in Pairs โ˜…โ˜…
206 Reverse Linked List โ˜…โ˜…
141 Linked List Cycle โ˜…โ˜… 142 fast/slow
23 Merge k Sorted Lists โ˜…โ˜…โ˜… 21 priority_queue
147 Insertion Sort List โ˜…โ˜…โ˜… insertion sort
148 Sort List โ˜…โ˜…โ˜…โ˜… merge sort O(1) space
707 Design Linked List โ˜…โ˜…โ˜…โ˜…

Tree

Id Name Difficulty Comments
94 Binary Tree Inorder Traversal โ˜… 589 590 traversal
100 Same Tree โ˜…โ˜… 101 104 110 111 572 965
102 Binary Tree Level Order Traversal โ˜…โ˜… 107 429 872 987 collecting nodes
814 Binary Tree Pruning โ˜…โ˜… 669
112 Path Sum โ˜…โ˜…โ˜… 113 437
124 Binary Tree Maximum Path Sum โ˜…โ˜…โ˜… 543 687 Use both children, return one
129 Sum Root to Leaf Numbers โ˜…โ˜…โ˜… 257
236 Lowest Common Ancestor of a Binary Tree โ˜…โ˜…โ˜… 235
297 Serialize and Deserialize Binary Tree โ˜…โ˜…โ˜… 449
508 Most Frequent Subtree Sum โ˜…โ˜…โ˜…
968 Binary Tree Cameras โ˜…โ˜…โ˜…โ˜… 337 979

Binary Search

Id Name Difficulty Comments
35 Search Insert Position โ˜…โ˜… 34 704 981 upper_bound
33 Search in Rotated Sorted Array โ˜…โ˜…โ˜… 81 153 154 162 852 rotated / peak
69 Sqrt(x) โ˜…โ˜…โ˜… upper_bound
74 Search a 2D Matrix โ˜…โ˜…โ˜… treat 2d as 1d
875 Koko Eating Bananas โ˜…โ˜…โ˜… 1011 guess ans and check
378 Kth Smallest Element in a Sorted Matrix โ˜…โ˜…โ˜… 668 kth + matrix
778 Swim in Rising Water โ˜…โ˜…โ˜… 174 875 guess ans and check
4 Median of Two Sorted Arrays โ˜…โ˜…โ˜…โ˜…
719 Find K-th Smallest Pair Distance โ˜…โ˜…โ˜…โ˜… 786 kth + two pointers

Binary Search Tree

Id Name Difficulty Comments
98 Validate Binary Search Tree โ˜…โ˜… 530 inorder
700 Search in a Binary Search Tree โ˜…โ˜… 701 binary search
230 Kth Smallest Element in a BST โ˜…โ˜…โ˜… inorder
99 Recover Binary Search Tree โ˜…โ˜…โ˜… inorder
108 Convert Sorted Array to Binary Search Tree โ˜…โ˜…โ˜…
501 Find Mode in Binary Search Tree โ˜…โ˜…โ˜… inorder
450 Delete Node in a BST โ˜…โ˜…โ˜…โ˜… binary search

Graph

Id Name Difficulty Comments
133 Clone Graph โ˜…โ˜… 138 queue + hashtable
200 Number of Islands โ˜…โ˜… 547 695 733 827 grid + connected components
841 Keys and Rooms โ˜…โ˜… connected components
207 Course Schedule โ˜…โ˜…โ˜… 210 802 topology sorting
399 Evaluate Division โ˜…โ˜…โ˜… 839 952 990 721 union find
785 Is Graph Bipartite? โ˜…โ˜…โ˜… bipartition
684 Redundant Connection โ˜…โ˜…โ˜…โ˜… 685 787 cycle, union find
743 Network Delay Time โ˜…โ˜…โ˜…โ˜… 882 shortest path
847 Shortest Path Visiting All Nodes โ˜…โ˜…โ˜…โ˜… 815 864 924 BFS
943 Find the Shortest Superstring โ˜…โ˜…โ˜…โ˜… 980 996 Hamiltonian path (DFS / DP)
959 Regions Cut By Slashes โ˜…โ˜…โ˜…โ˜… union find / grid + connected component
332 Reconstruct Itinerary โ˜…โ˜…โ˜…โ˜… Eulerian path
1192 Critical Connections in a Network โ˜…โ˜…โ˜…โ˜… Tarjan

Dynamic Programming

Id Name Difficulty Comments
70 Climbing Stairs โ˜… 746 I: O(n), S = O(n), T = O(n)
303 Range Sum Query - Immutable โ˜…
53 Maximum Subarray โ˜…โ˜… 121
198 House Robber โ˜…โ˜…โ˜… 213 309 740 790 801 I: O(n), S = O(3n), T = O(3n)
139 Word Break โ˜…โ˜…โ˜… 140 818 I: O(n), S = O(n), T = O(n^2)
300 Longest Increasing Subsequence โ˜…โ˜…โ˜… 673
72 Edit Distance โ˜…โ˜…โ˜… 10 44 97 115 583 712 I: O(m+n), S = O(mn), T = O(mn)
322 Coin Change โ˜…โ˜…โ˜… 377 416 494 I: O(n) + k, S = O(n), T = O(kn)
813 Largest Sum of Averages โ˜…โ˜…โ˜… I: O(n) + k, S = O(n), T = O(kn^2)
312 Burst Balloons โ˜…โ˜…โ˜…โ˜… 664 1024 1039 I: O(n), S = O(n^2), T = O(n^3)
741 Cherry Pickup โ˜…โ˜…โ˜…โ˜… I: O(n^2), S = O(n^3), T = O(n^3)
546 Remove Boxes โ˜…โ˜…โ˜…โ˜…โ˜… I: O(n), S = O(n^3), T = O(n^4)
943 Find the Shortest Superstring โ˜…โ˜…โ˜…โ˜… 980 996 I: O(n), S = O(n2^n), T = (n^22^n)
62 Unique Paths โ˜…โ˜… 63 64 120 174 931 I: O(mn), S = O(mn), T = O(mn)
85 Maximal Rectangle โ˜…โ˜…โ˜… 221 304
688 Knight Probability in Chessboard โ˜…โ˜…โ˜… 576 935 I: O(mn) + k, S = O(kmn) T = O(kmn)
322 Coin Change โ˜…โ˜…โ˜… 377 416 494 1043 1049 I: O(n) + k, S = O(n), T = O(kn)
1220 1230 1262 1269
813 Largest Sum of Averages โ˜…โ˜…โ˜…โ˜… 1278 1335 410 I: O(n) + k
S = O(n*k), T = O(kn^2)
1223 Dice Roll Simulation โ˜…โ˜…โ˜…โ˜… I: O(n) + k + p
S = O(k*p), T = O(n^2kp)
312 Burst Balloons โ˜…โ˜…โ˜…โ˜… 664 1024 1039 1140 1130 I: O(n), S = O(n^2), T = O(n^3)
741 Cherry Pickup โ˜…โ˜…โ˜…โ˜… I: O(n^2), S = O(n^3), T = O(n^3)
546 Remove Boxes โ˜…โ˜…โ˜…โ˜…โ˜… I: O(n), S = O(n^3), T = O(n^4)
943 Find the Shortest Superstring โ˜…โ˜…โ˜…โ˜…โ˜… 980 996 1125 I: O(n)
S = O(n2^n), T = (n^22^n)

Advanced

Id Name Difficulty Comments
208 Implement Trie (Prefix Tree) โ˜…โ˜…โ˜… 648 676 677 720 745 Trie
307 Range Sum Query - Mutable โ˜…โ˜…โ˜… BIT/Segment Tree
901 Online Stock Span โ˜…โ˜…โ˜… 907 1019 Monotonic Stack
239 Sliding Window Maximum โ˜…โ˜…โ˜… Monotonic Queue

This list is made by huahua, I found this on his youtube. Please visit his website for more.

Software Engineer Interview

Overall Mindset

  1. Having a right mindset is the most important one. It keeps you going when you are tired after work. Studying when everyone else are out having fun. Reminding you that your goals are not going to come easy, it takes time, self-discipline, mental and physical toughness...

  2. How to Get a Job at the Big 4.

  3. How I Got a Job at Google as a Software Engineer.

  4. The #1 Daily Habit of Those Who Dominate with Andy Frisella. It is also avaliable on Spotify or Youtube, just google it.

Prepare in a Structural Way

  1. How should I prepare for my Google interview if I have 1 month left and Iโ€™m applying for a software engineer role?

  2. How can I get a job at Facebook or Google in 6 months?

  3. What should I know from the CLRS 3rd edition book if my aim is to get into Google?

Data Structures and Algorithms for beginners

If you are new or know nothing about data structures and algorithms, I recommend this course. This course is taught in Python and design to help you find job and do well in the interview.

System Design

  1. More resource

  2. Architecture 101

  3. Systems Design Interview Concepts. There are also lots of tech interview related topic in his channel.

  4. Narendra's Youtube Channel

Knowledge Base Question

  1. Session vs Cookie
  2. Token Authentication
  3. TCP/UDP
    • Transport Layer
      • Application Layer (HTTP, FTP)
      • Transport Layer (UDP/TCP, Slice data to small packages)
      • Network Layer (IP)
      • Link Layer (Wifi)
      • Physical Layer (Coaxial Ethernet Cable)
    • UDP has smaller package size (8 bytes), while TCP needs 20 bytes due to it has larger header.
    • UDP are not order guaranteed. TCP are in order.
    • They both have error messages, but TCP will resent it again, UDP does not.
    • TCP needs a three-way handshake to initiate a connection between ports. Itโ€™s like a phone call. While UDP is like a mail.
    • In short, UDP is smaller and faster while TCP is reliable and ordered.
    • UDP example, video streaming, DNS lookups.
  4. HTTPS, CA, PKI
  5. HTTP, HTTP Code, Socket, WebSocket, HTTP KeepAlive, HTTP2
  6. DNS, CNAME, NS, A, AAAA, IPv4, IPv6
  7. Code, Process, Thread
  8. Stack memory vs Heap memory
    • Stack memory

      • Stores temporary variable created by functions.
      • Memory is managed by CPU for you. No need to allocate and free it by hand.
      • L.I.F.O.
      • Stacks has limit (That is why we seldom use recursion real life)
      • Stacks variable are local variable in nature.
    • Heap memory

      • Larger.
      • Slightly slower. Because we has to use "pointers" to access.
      • We are responsible to free() the memory.
      • Heap variable is global variable in nature.
  9. GET vs POST
  10. CORS
    ...

Others

Resume

https://drive.google.com/file/d/10b9NZDhPbUOW_C7108IKe9ev6Ed2UG7F/view

Interview Question Survey

https://www.glassdoor.com/index.htm
https://www.careercup.com/

Offer Negotiation

https://haseebq.com/my-ten-rules-for-negotiating-a-job-offer/

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].