SWE Prep
Subscribe
Sign in
Home
Archive
About
Latest
Top
Count Largest Group
Lessons Learned: HashMaps
Apr 23, 2021
•
Sameer Khoja
Share this post
Count Largest Group
sweprep.substack.com
Copy link
Facebook
Email
Note
Other
Invert Binary Tree
Question: Invert a binary tree. Input: 4 / \ 2 7 / \ / \ 1 3 6 9 Output: 4 / \ 7 2 / \ / \ 9 6 3 1 Solution Approach 1: Recursive The inverse of an…
Apr 14, 2021
•
Sameer Khoja
Share this post
Invert Binary Tree
sweprep.substack.com
Copy link
Facebook
Email
Note
Other
Divisor Game
Alice and Bob take turns playing a game, with Alice starting first. Initially, there is a number N on the chalkboard. On each player's turn, that player…
Apr 7, 2021
•
Sameer Khoja
Share this post
Divisor Game
sweprep.substack.com
Copy link
Facebook
Email
Note
Other
March 2021
Single Number
Question: Given a non-empty array of integers nums, every element appears twice except for one. Find that single one. Solution Approach 1: Hash Table We…
Mar 31, 2021
•
Sameer Khoja
Share this post
Single Number
sweprep.substack.com
Copy link
Facebook
Email
Note
Other
Smallest Range
Given an array A of integers, for each integer A[i] we may choose any x with -K <= x <= K, and add x to A[i]. After this process, we have some array B…
Mar 24, 2021
•
Sameer Khoja
Share this post
Smallest Range
sweprep.substack.com
Copy link
Facebook
Email
Note
Other
Find the Distance Value Between Two Arrays
Lessons Learned: TreeSet, Array Manipulation
Mar 7, 2021
•
Sameer Khoja
Share this post
Find the Distance Value Between Two Arrays
sweprep.substack.com
Copy link
Facebook
Email
Note
Other
February 2021
Valid Parentheses II
Question: Implement an algorithm to print all valid (properly opened and closed) combinations of n pairs of parentheses.
Feb 28, 2021
•
Sameer Khoja
Share this post
Valid Parentheses II
sweprep.substack.com
Copy link
Facebook
Email
Note
Other
Median of Two Sorted Arrays
Lessons Learned: Array parsing
Feb 21, 2021
•
Sameer Khoja
Share this post
Median of Two Sorted Arrays
sweprep.substack.com
Copy link
Facebook
Email
Note
Other
Word Ladder
The problem: Given two words (start and end), and a dictionary, find the length of shortest transformation sequence from start to end.
Feb 14, 2021
•
Sameer Khoja
Share this post
Word Ladder
sweprep.substack.com
Copy link
Facebook
Email
Note
Other
Word Break II
Lessons learned: DFS
Feb 4, 2021
•
Sameer Khoja
Share this post
Word Break II
sweprep.substack.com
Copy link
Facebook
Email
Note
Other
January 2021
Word Break
Question: Given a string s and a dictionary of words dict, determine if s can be segmented into a space-separated sequence of one or more dictionary…
Jan 27, 2021
•
Sameer Khoja
Share this post
Word Break
sweprep.substack.com
Copy link
Facebook
Email
Note
Other
Longest Palindromic Substring
👋 Hello! I’m gathering feedback on SWE Prep. If you like to provide suggestions or feedback, let us know on this survey here! Question: Given a string…
Jan 22, 2021
•
Sameer Khoja
Share this post
Longest Palindromic Substring
sweprep.substack.com
Copy link
Facebook
Email
Note
Other
Share
Copy link
Facebook
Email
Note
Other
This site requires JavaScript to run correctly. Please
turn on JavaScript
or unblock scripts