Homepage
Open in app
Sign in
Get started
Data Science
Life
Top Interview Questions
Blind 75 / NeetCode 150 / Grind169
SQL
Easy
Medium
Sharko Shen's LinkedIn
Top Interview Questions
251. Flatten 2D Vector
Design an iterator to flatten a 2D vector. It should support the next and hasNext operations.
Sharko Shen
May 30, 2023
324. Wiggle Sort II
Given an integer array nums, reorder it such that nums[0] < nums[1] > nums[2] < nums[3]....
Sharko Shen
May 30, 2023
384. Shuffle an Array
Given an integer array nums, design an algorithm to randomly shuffle the array. All permutations of the array should be equally likely as a…
Sharko Shen
May 30, 2023
166. Fraction to Recurring Decimal
Given two integers representing the numerator and denominator of a fraction, return the fraction in string format.
Sharko Shen
May 29, 2023
378. Kth Smallest Element in a Sorted Matrix
Given an n x n matrix where each of the rows and columns is sorted in ascending order, return the kth smallest element in the matrix.
Sharko Shen
May 29, 2023
277. Find the Celebrity
Suppose you are at a party with n people labeled from 0 to n - 1 and among them, there may exist one celebrity. The definition of a…
Sharko Shen
May 29, 2023
116. Populating Next Right Pointers in Each Node
116. Populating Next Right Pointers in Each Node
You are given a perfect binary tree where all leaves are on the same level, and every parent has two children. The binary tree has the…
Sharko Shen
May 29, 2023
285. Inorder Successor in BST
Given the root of a binary search tree and a node p in it, return the in-order successor of that node in the BST. If the given node has no…
Sharko Shen
May 29, 2023
454. 4Sum II
Given four integer arrays nums1, nums2, nums3, and nums4 all of length n, return the number of tuples (i, j, k, l) such that:
Sharko Shen
May 29, 2023
348. Design Tic-Tac-Toe
Assume the following rules are for the tic-tac-toe game on an n x n board between two players:
Sharko Shen
May 29, 2023
163. Missing Ranges
You are given an inclusive range [lower, upper] and a sorted unique integer array nums, where all elements are within the inclusive range.
Sharko Shen
May 29, 2023
326. Power of Three
Given an integer n, return true if it is a power of three. Otherwise, return false.
Sharko Shen
May 28, 2023
315. Count of Smaller Numbers After Self
Given an integer array nums, return an integer array counts where counts[i] is the number of smaller elements to the right of nums[i].
Sharko Shen
May 28, 2023
340. Longest Substring with At Most K Distinct Characters
Given a string s and an integer k, return the length of the longest
Sharko Shen
May 28, 2023
148. Sort List
148. Sort List
Given the head of a linked list, return the list after sorting it in ascending order.
Sharko Shen
May 26, 2023
8. String to Integer (atoi)
Implement the myAtoi(string s) function, which converts a string to a 32-bit signed integer (similar to C/C++'s atoi function).
Sharko Shen
May 25, 2023
308. Range Sum Query 2D — Mutable
308. Range Sum Query 2D — Mutable
Given a 2D matrix matrix, handle multiple queries of the following types:
Sharko Shen
May 25, 2023
395. Longest Substring with At Least K Repeating Characters
Given a string s and an integer k, return the length of the longest substring of s such that the frequency of each character in this…
Sharko Shen
May 25, 2023
240. Search a 2D Matrix II
240. Search a 2D Matrix II
Write an efficient algorithm that searches for a value target in an m x n integer matrix matrix. This matrix has the following properties:
Sharko Shen
May 25, 2023
29. Divide Two Integers
Given two integers dividend and divisor, divide two integers without using multiplication, division, and mod operator.
Sharko Shen
May 25, 2023
341. Flatten Nested List Iterator
You are given a nested list of integers nestedList. Each element is either an integer or a list whose elements may also be integers or…
Sharko Shen
May 24, 2023
44. Wildcard Matching
Given an input string (s) and a pattern (p), implement wildcard pattern matching with support for '?' and '*' where:
Sharko Shen
May 22, 2023
227. Basic Calculator II
Given a string s which represents an expression, evaluate this expression and return its value.
Sharko Shen
May 22, 2023
172. Factorial Trailing Zeroes
Given an integer n, return the number of trailing zeroes in n!.
Sharko Shen
May 21, 2023
190. Reverse Bits
Reverse bits of a given 32 bits unsigned integer.
Sharko Shen
May 21, 2023
About Data Science & LeetCode for Kindergarten
Latest Stories
Archive
About Medium
Terms
Privacy
Teams