LeetCode Top Interview Questions
littlehaes
这个作者很懒,什么都没留下…
展开
-
LeetCode Top Interview Questions 454. 4Sum II (Java版; Meidum)
welcome to my blogLeetCode Top Interview Questions 454. 4Sum II (Java版; Meidum)题目描述Given four lists A, B, C, D of integer values, compute how many tuples (i, j, k, l) there are such that A[i] + B[...原创 2020-02-01 11:07:20 · 98 阅读 · 0 评论 -
LeetCode Top Interview Questions 412. Fizz Buzz (Java版; Easy)
welcome to my blogLeetCode Top Interview Questions 412. Fizz Buzz (Java版; Easy)题目描述Write a program that outputs the string representation of numbers from 1 to n.But for multiples of three it shou...原创 2020-02-01 10:33:01 · 453 阅读 · 0 评论 -
LeetCode Top Interview Questions 395. Longest Substring with At Least K Repeating Characters (Medium
welcome to my blogLeetCode Top Interview Questions 395. Longest Substring with At Least K Repeating Characters (Java版; Meidum)题目描述Find the length of the longest substring T of a given string (consi...原创 2020-01-31 13:59:55 · 148 阅读 · 0 评论 -
LeetCode Top Interview Questions 387. First Unique Character in a String (Java版; Easy)
welcome to my blogLeetCode Top Interview Questions 387. First Unique Character in a String (Java版; Easy)题目描述Given a string, find the first non-repeating character in it and return it's index. If it...原创 2020-01-31 12:18:33 · 165 阅读 · 0 评论 -
LeetCode Top Interview Questions 384. Shuffle an Array (Java版; Meidum)
welcome to my blogLeetCode Top Interview Questions 384. Shuffle an Array (Java版; Meidum)题目描述Shuffle a set of numbers without duplicates.Example:// Init an array with set 1, 2, and 3.int[] nums...原创 2020-01-31 11:59:59 · 164 阅读 · 0 评论 -
LeetCode Top Interview Questions 380. Insert Delete GetRandom O(1) (Java版; Meidum)
welcome to my blogLeetCode Top Interview Questions 380. Insert Delete GetRandom O(1) (Java版; Meidum)题目描述Design a data structure that supports all following operations in average O(1) time.insert...原创 2020-01-31 10:57:56 · 237 阅读 · 0 评论 -
LeetCode Top Interview Questions 378. Kth Smallest Element in a Sorted Matrix (Java版; Meidum)
welcome to my blogLeetCode Top Interview Questions 378. Kth Smallest Element in a Sorted Matrix (Java版; Meidum)题目描述Given a n x n matrix where each of the rows and columns are sorted in ascending or...原创 2020-01-30 17:57:49 · 191 阅读 · 0 评论 -
LeetCode Top Interview Questions 371. Sum of Two Integers (Java版; Easy)
welcome to my blogLeetCode Top Interview Questions 371. Sum of Two Integers (Java版; Easy)题目描述Calculate the sum of two integers a and b, but you are not allowed to use the operator + and -.Example...原创 2020-01-30 12:39:21 · 113 阅读 · 0 评论 -
LeetCode Top Interview Questions 350. Intersection of Two Arrays II (Java版; Easy)
welcome to my blogLeetCode Top Interview Questions 350. Intersection of Two Arrays II (Java版; Easy)题目描述Given two arrays, write a function to compute their intersection.Example 1:Input: nums1 =...原创 2020-01-30 12:13:17 · 91 阅读 · 0 评论 -
LeetCode Top Interview Questions 348. Design Tic-Tac-Toe (Java版; Medium)
welcome to my blogLeetCode Top Interview Questions 350. Design Tic-Tac-Toe (Java版; Medium)题目描述You may assume the following rules:A move is guaranteed to be valid and is placed on an empty block....原创 2020-02-07 22:43:37 · 199 阅读 · 0 评论 -
LeetCode Top Interview Questions 344. Reverse String (Java版; Easy)
welcome to my blogLeetCode Top Interview Questions 344. Reverse String (Java版; Easy)题目描述Write a function that reverses a string. The input string is given as an array of characters char[].Do not ...原创 2020-02-28 10:34:28 · 160 阅读 · 0 评论 -
LeetCode Top Interview Questions 341. Flatten Nested List Iterator (Java版; Medium)
welcome to my blogLeetCode Top Interview Questions 341. Flatten Nested List Iterator (Java版; Medium)题目描述Given a nested list of integers, implement an iterator to flatten it.Each element is eithe...原创 2020-01-30 10:34:56 · 121 阅读 · 0 评论 -
LeetCode Top Interview Questions 340. Longest Substring with At Most K Distinct Characters (Java版;
welcome to my blogLeetCode Top Interview Questions 340. Longest Substring with At Most K Distinct Characters (Java版; Hard)题目描述Given a string, find the length of the longest substring T that contai...原创 2020-02-07 21:20:30 · 150 阅读 · 0 评论 -
LeetCode Top Interview Questions 334. Increasing Triplet Subsequence (Java版; Medium)
welcome to my blogLeetCode Top Interview Questions 334. Increasing Triplet Subsequence (Java版; Medium)题目描述Given an unsorted array return whether an increasing subsequence of length 3 exists or not...原创 2020-01-29 12:43:52 · 155 阅读 · 0 评论 -
LeetCode Top Interview Questions 329. Longest Increasing Path in a Matrix (Java版; Hard)
welcome to my blogLeetCode Top Interview Questions 329. Longest Increasing Path in a Matrix (Java版; Hard)题目描述Given an integer matrix, find the length of the longest increasing path.From each cell...原创 2020-01-29 12:15:05 · 191 阅读 · 0 评论 -
LeetCode Top Interview Questions 328. Odd Even Linked List (Java版; Medium)
welcome to my blogLeetCode Top Interview Questions 328. Odd Even Linked List (Java版; Medium)题目描述Given a singly linked list, group all odd nodes together followed by the even nodes. Please note here...原创 2020-01-26 23:39:49 · 123 阅读 · 0 评论 -
LeetCode Top Interview Questions 326. Power of Three (Java版; Easy)
welcome to my blogLeetCode Top Interview Questions 326. Power of Three (Java版; Easy)题目描述Given an integer, write a function to determine if it is a power of three.Example 1:Input: 27Output: tru...原创 2020-01-28 19:40:40 · 175 阅读 · 0 评论 -
LeetCode Top Interview Questions 324. Wiggle Sort II (Java版; Medium)
welcome to my blogLeetCode Top Interview Questions 324. Odd Even Linked List (Java版; Medium)题目描述Given an unsorted array nums, reorder it such that nums[0] < nums[1] > nums[2] < nums[3].......原创 2020-01-28 15:39:49 · 116 阅读 · 0 评论 -
LeetCode Top Interview Questions 315. Count of Smaller Numbers After Self (Java版; Hard)
welcome to my blogLeetCode Top Interview Questions 315. Count of Smaller Numbers After Self (Java版; Hard)题目描述You are given an integer array nums and you have to return a new counts array. The count...原创 2020-01-28 11:26:08 · 122 阅读 · 0 评论 -
LeetCode Top 100 Liked Questions 308. Range Sum Query 2D - Mutable (Java版; Hard)
welcome to my blogLeetCode Top 100 Liked Questions 308. Range Sum Query 2D - Mutable (Java版; Hard)题目描述Given a 2D matrix matrix, find the sum of the elements inside the rectangle defined by its uppe...原创 2020-02-07 18:22:51 · 167 阅读 · 0 评论 -
LeetCode Top Interview Questions 295. Find Median from Data Stream (Java版; Hard)
welcome to my blogLeetCode Top Interview Questions 295. Find Median from Data Stream (Java版; Hard)题目描述Median is the middle value in an ordered integer list. If the size of the list is even, there ...原创 2019-12-15 10:00:14 · 136 阅读 · 0 评论 -
LeetCode Top Interview Questions 289. Game of Life (Java版; Medium)
welcome to my blogLeetCode Top Interview Questions 289. Game of Life (Java版; Medium)题目描述According to the Wikipedia's article: "The Game of Life, also known simply as Life, is a cellular automaton ...原创 2019-12-14 23:53:07 · 132 阅读 · 0 评论 -
LeetCode Top Interview Questions 285. Inorder Successor in BST (Java版; Medium)
welcome to my blogLeetCode Top Interview Questions 285. Inorder Successor in BST (Java版; Medium)题目描述Given a binary search tree and a node in it, find the in-order successor of that node in the BST....原创 2020-02-06 13:05:51 · 188 阅读 · 0 评论 -
LeetCode Top Interview Questions 277. Find the Celebrity (Java版; Medium)
welcome to my blogLeetCode Top Interview Questions 277. Find the Celebrity (Java版; Medium)题目描述Suppose you are at a party with n people (labeled from 0 to n - 1) and among them, there may exist one...原创 2020-02-06 11:47:04 · 195 阅读 · 0 评论 -
LeetCode Top Interview Questions 269. Alien Dictionary (Java版; Hard)
welcome to my blogLeetCode Top Interview Questions 269. Alien Dictionary (Java版; Hard)题目描述There is a new alien language which uses the latin alphabet. However, the order among letters are unknown t...原创 2020-02-06 10:45:12 · 290 阅读 · 0 评论 -
LeetCode Top Interview Questions 268. Missing Number (Java版; Easy)
welcome to my blogLeetCode Top Interview Questions 268. Missing Number (Java版; Easy)题目描述Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from th...原创 2019-12-13 08:35:04 · 117 阅读 · 0 评论 -
LeetCode Top Interview Questions 251. Flatten 2D Vector (Java版; Medium)
welcome to my blogLeetCode Top Interview Questions 251. Flatten 2D Vector (Java版; Medium)题目描述Design and implement an iterator to flatten a 2d vector. It should support the following operations: nex...原创 2020-02-05 16:16:08 · 138 阅读 · 0 评论 -
LeetCode Top Interview Questions 242. Valid Anagram (Java版; Easy)
welcome to my blogLeetCode Top Interview Questions 242. Valid Anagram (Java版; Easy)题目描述Given two strings s and t , write a function to determine if t is an anagram of s.Example 1:Input: s = "an...原创 2019-12-12 14:45:30 · 118 阅读 · 0 评论 -
LeetCode Top Interview Questions 237. Delete Node in a Linked List (Java版; Easy)
welcome to my blogLeetCode Top Interview Questions 237. Delete Node in a Linked List (Java版; Easy)题目描述Write a function to delete a node (except the tail) in a singly linked list, given only access ...原创 2019-12-08 18:45:44 · 77 阅读 · 0 评论 -
LeetCode Top Interview Questions 230. Kth Smallest Element in a BST (Java版; Medium)
welcome to my blogLeetCode Top Interview Questions 230. Kth Smallest Element in a BST (Java版; Medium)题目描述Given a binary search tree, write a function kthSmallest to find the kth smallest element in...原创 2019-12-11 08:37:12 · 119 阅读 · 0 评论 -
LeetCode Top Interview Questions 227. Basic Calculator II (Java版; Medium)
welcome to my blogLeetCode Top Interview Questions 227. Basic Calculator II (Java版; Medium)题目描述Implement a basic calculator to evaluate a simple expression string.The expression string contains o...原创 2019-12-11 09:41:06 · 113 阅读 · 0 评论 -
LeetCode Top Interview Questions 218. The Skyline Problem (Java版; Hard)
welcome to my blogLeetCode Top Interview Questions 218. The Skyline Problem (Java版; Hard)题目描述A city's skyline is the outer contour of the silhouette formed by all the buildings in that city when vi...原创 2019-12-09 10:48:11 · 134 阅读 · 0 评论 -
LeetCode Top Interview Questions 217. Contains Duplicate (Java版; Easy)
welcome to my blogLeetCode Top Interview Questions 217. Contains Duplicate (Java版; Easy)题目描述Given an array of integers, find if the array contains any duplicates.Your function should return true ...原创 2019-12-08 18:41:53 · 100 阅读 · 0 评论 -
LeetCode Top Interview Questions 212. Word Search II (Java版; Hard)
welcome to my blogLeetCode Top Interview Questions 212. Word Search II (Java版; Hard)题目描述Given a 2D board and a list of words from the dictionary, find all words in the board.Each word must be con...原创 2019-12-08 18:29:42 · 114 阅读 · 0 评论 -
LeetCode Top Interview Questions 204. Count Primes (Java版; Easy)
welcome to my blogLeetCode Top Interview Questions 204. Count Primes (Java版; Easy)题目描述Count the number of prime numbers less than a non-negative number, n.Example:Input: 10Output: 4Explanatio...原创 2019-12-05 08:27:56 · 105 阅读 · 0 评论 -
LeetCode Top Interview Questions 202. Happy Number (Java版; Easy)
welcome to my blogLeetCode Top Interview Questions 202. Happy Number (Java版; Easy)题目描述Write an algorithm to determine if a number is "happy".A happy number is a number defined by the following pr...原创 2019-12-04 14:32:26 · 85 阅读 · 0 评论 -
LeetCode Top Interview Questions 191. Number of 1 Bits (Java版; Easy)
welcome to my blogLeetCode Top Interview Questions 191. Number of 1 Bits (Java版; Easy)题目描述Write a function that takes an unsigned integer and return the number of '1' bits it has (also kn...原创 2019-12-03 09:12:19 · 108 阅读 · 0 评论 -
LeetCode Top Interview Questions 190. Reverse Bits (Java版; Easy)
welcome to my blogLeetCode Top Interview Questions 190. Reverse Bits (Java版; Easy)题目描述Reverse bits of a given 32 bits unsigned integer.Example 1:Input: 00000010100101000001111010011100Output: ...原创 2019-12-03 09:11:26 · 91 阅读 · 0 评论 -
LeetCode Top Interview Questions 189. Rotate Array (Java版; Easy)
welcome to my blogLeetCode Top Interview Questions 189. Rotate Array (Java版; Easy)题目描述Given an array, rotate the array to the right by k steps, where k is non-negative.Example 1:Input: [1,2,3,4...原创 2019-12-02 21:33:01 · 138 阅读 · 0 评论 -
LeetCode Top Interview Questions 179. Largest Number (Java版; Medium)
welcome to my blogLeetCode Top Interview Questions 179. Largest Number (Java版; Medium)题目描述Given a list of non negative integers, arrange them such that they form the largest number.Example 1:In...原创 2019-12-01 22:28:35 · 139 阅读 · 0 评论