Open in app

Sign In

Write

Sign In

stevecaoleetcodes
stevecaoleetcodes

11 Followers

Home

About

Jul 11, 2022

424 — Longest Repeating Character Replacement

Restating Info We’re Already Given: Given a string s of length between 1 and 100,000 inclusive with all uppercase English letters, we want to find the longest substring of 1 character with k wildcards (a character that is any character but the most frequent one in the substring). Questions/Clarifications to Possibly Ask Interviewer (If starting information we’re given isn’t sufficient to begin): N/A

Leetcode

2 min read

424 — Longest Repeating Character Replacement
424 — Longest Repeating Character Replacement
Leetcode

2 min read


Jul 9, 2022

238 — Product of Array Except Self

Restating Info We’re Already Given: We’re given an integer array with a length anywhere between 2 and 100,000 inclusive. Each of the integers is limited to between -30 and 30. No integer overflow will occur since each prefix/suffix fits in a 32-bit integer. (I’m using Python so doesn’t matter in this specific case) Questions/Clarifications to Possibly Ask Interviewer (If starting information we’re given isn’t sufficient to begin):

Leetcode

2 min read

238 — Product of Array Except Self
238 — Product of Array Except Self
Leetcode

2 min read


Jul 3, 2022

417 — Pacific Atlantic Water Flow

Restating Info We’re Already Given: Treating the matrix like a map, the north and west borders are the Pacific Ocean and the south and east borders are the Atlantic Ocean. Following the map analogy, each value represents the altitude at that (row, col) pair and thus water will flow from higher to lower (or same…

Leetcode Medium

2 min read

417 — Pacific Atlantic Water Flow
417 — Pacific Atlantic Water Flow
Leetcode Medium

2 min read


Jul 2, 2022

54 — Spiral Matrix

Restating Info We’re Already Given: Return the elements of a 2D matrix in clockwise, outward to inward order. Based on the problem’s constraints, a 1x1 is the smallest matrix that could potentially be passed in. Questions/Clarifications to Possibly Ask Interviewer (If starting information we’re given isn’t sufficient to begin): Can anything be said about the uniqueness of the numbers? Discuss Solution #1:

Leetcode

2 min read

54 — Spiral Matrix
54 — Spiral Matrix
Leetcode

2 min read


Jun 19, 2022

104 — Maximum Depth of a Binary Tree

Restating Info We’re Already Given: We want to find the maximum depth of the binary tree, beginning at depth 1 for the root. Questions/Clarifications to Possibly Ask Interviewer (If starting information we’re given isn’t sufficient to begin): Do you care if I do this iteratively or recursively? Discuss Recursive Solution: One way we can solve this is recursively. To do so, we will call the function again on the left and right…

Leetcode

3 min read

104 — Maximum Depth of a Binary Tree
104 — Maximum Depth of a Binary Tree
Leetcode

3 min read


Jun 19, 2022

141 — Linked List Cycle

Leetcode

2 min read

141 — Linked List Cycle
141 — Linked List Cycle
Leetcode

2 min read


May 31, 2022

11 — Container With Most Water

Restating Info We’re Already Given: The height array has n values, each of which is a vertical line. The water contained within 2 indices is the minimum of their heights * distance between them We’re trying to find the maximum amount of water that can be stored in this heights array. Questions/Clarifications to Possibly Ask Interviewer (If starting information we’re given isn’t sufficient to begin):

Leetcode

2 min read

11 — Container With Most Water
11 — Container With Most Water
Leetcode

2 min read


May 29, 2022

3–Longest Substring Without Repeating Characters

Restating Info We’re Already Given: Here, we’re given a string s and have to find the longest substring that doesn’t have any repeating characters. Then, we return the length of that substring. Questions/Clarifications to Possibly Ask Interviewer (If starting information we’re given isn’t sufficient to begin): I see all the test cases only contain letters, should this be able to handle any character (i.e. unicode) or just letters?

Leetcode

2 min read

3–Longest Substring Without Repeating Characters
3–Longest Substring Without Repeating Characters
Leetcode

2 min read


May 22, 2022

322 — Coin Change

Restating Info We’re Already Given: We have to find the minimum number of coins needed to create the amount only using coin values in the coins array. If this isn’t possible, we return 1. We have an infinite amount of each coin in coins. Questions/Clarifications to Possibly Ask Interviewer (If starting information we’re given isn’t sufficient to begin): Should we return -1 if all coins are of greater denomination…

Leetcode

3 min read

322 — Coin Change
322 — Coin Change
Leetcode

3 min read


May 15, 2022

73 — Set Matrix Zeroes

Restating Info We’re Already Given: For each row and for each column, if there is a 0 in that respective row or column, we want to make all values in that row or column 0. We must do this in-place, so we cannot just recreate the array with zeroes filled in. Questions/Clarifications to Possibly Ask Interviewer (If starting information we’re given isn’t sufficient to begin): I can solve this…

Leetcode

4 min read

73 — Set Matrix Zeroes
73 — Set Matrix Zeroes
Leetcode

4 min read

stevecaoleetcodes

stevecaoleetcodes

11 Followers

Popular leetcode problems and their explanations

Help

Status

Writers

Blog

Careers

Privacy

Terms

About

Text to speech

Teams