LeetCode
littlehaes
这个作者很懒,什么都没留下…
展开
-
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 · 123 阅读 · 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 · 126 阅读 · 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 · 110 阅读 · 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 · 114 阅读 · 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 · 106 阅读 · 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 · 102 阅读 · 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 · 127 阅读 · 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 · 67 阅读 · 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 · 92 阅读 · 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 · 98 阅读 · 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 · 77 阅读 · 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 · 98 阅读 · 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 · 81 阅读 · 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 · 131 阅读 · 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 · 124 阅读 · 0 评论 -
LeetCode Top Interview Questions 172. Factorial Trailing Zeroes (Java版; Easy)
welcome to my blogLeetCode Top Interview Questions 172. Factorial Trailing Zeroes (Java版; Easy)题目描述Given an integer n, return the number of trailing zeroes in n!.Example 1:Input: 3Output: 0Ex...原创 2019-12-01 21:46:58 · 93 阅读 · 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-11-29 08:53:16 · 84 阅读 · 0 评论 -
LeetCode Top Interview Questions 171. Excel Sheet Column Number (Java版; Easy)
welcome to my blogLeetCode Top Interview Questions 171. Excel Sheet Column Number (Java版; Easy)题目描述Given a column title as appear in an Excel sheet, return its corresponding column number.For exa...原创 2019-11-28 08:14:12 · 107 阅读 · 0 评论 -
LeetCode Top Interview Questions 166. Fraction to Recurring Decimal (Java版; Medium)
welcome to my blogLeetCode Top Interview Questions 166. Fraction to Recurring Decimal (Java版; Medium)题目描述Given two integers representing the numerator and denominator of a fraction, return the frac...原创 2019-11-27 09:19:55 · 104 阅读 · 0 评论 -
LeetCode Top Interview Questions 162. Find Peak Element (Java版; Medium)
welcome to my blogLeetCode Top Interview Questions 162. Find Peak Element (Java版; Medium)题目描述A peak element is an element that is greater than its neighbors.Given an input array nums, where nums[...原创 2019-11-26 08:34:19 · 86 阅读 · 0 评论 -
LeetCode Top Interview Questions 150. Evaluate Reverse Polish Notation (Java版; Medium)
welcome to my blogLeetCode Top Interview Questions 150. Evaluate Reverse Polish Notation (Java版; Medium)题目描述Evaluate the value of an arithmetic expression in Reverse Polish Notation.Valid operato...原创 2019-11-25 17:56:40 · 134 阅读 · 0 评论 -
LeetCode Top Interview Questions 149. Max Points on a Line (Java版; Hard)
welcome to my blogLeetCode Top Interview Questions 149. Max Points on a Line (Java版; Hard)题目描述Given n points on a 2D plane, find the maximum number of points that lie on the same straight line.Ex...原创 2019-11-24 15:47:23 · 92 阅读 · 0 评论 -
LeetCode Top Interview Questions 140. Word Break II (Java版; Hard)
welcome to my blogLeetCode Top Interview Questions 140. Word Break II (Java版; Hard)题目描述Given a non-empty string s and a dictionary wordDict containing a list of non-empty words, add spaces in s to ...原创 2019-11-24 15:34:26 · 90 阅读 · 0 评论 -
LeetCode Top Interview Questions 138. Copy List with Random Pointer (Java版; Medium)
welcome to my blogLeetCode Top Interview Questions 138. Copy List with Random Pointer (Java版; Medium)题目描述A linked list is given such that each node contains an additional random pointer which could...原创 2019-11-22 23:40:19 · 87 阅读 · 0 评论 -
LeetCode Top Interview Questions 134. Gas Station (Java版; Medium)
welcome to my blogLeetCode Top Interview Questions 134. Gas Station (Java版; Medium)题目描述There are N gas stations along a circular route, where the amount of gas at station i is gas[i].You have a c...原创 2019-11-22 12:55:33 · 108 阅读 · 0 评论 -
LeetCode Top Interview Questions 131. Palindrome Partitioning (Java版; Medium)
welcome to my blogLeetCode Top Interview Questions 131. Palindrome Partitioning (Java版; Medium)题目描述Given a string s, partition s such that every substring of the partition is a palindrome.Return ...原创 2019-11-21 09:00:12 · 115 阅读 · 0 评论 -
LeetCode Top Interview Questions 130. Surrounded Regions (Java版; Medium)
welcome to my blogLeetCode Top Interview Questions 130. Surrounded Regions (Java版; Medium)题目描述Given a 2D board containing 'X' and 'O' (the letter O), capture all regions surrounded by 'X'.A regio...原创 2019-11-21 00:09:04 · 106 阅读 · 0 评论 -
LeetCode Top Interview Questions 127. Word Ladder (Java版; Medium)
welcome to my blogLeetCode Top Interview Questions 127. Word Ladder (Java版; Medium)题目描述Given two words (beginWord and endWord), and a dictionary's word list, find the length of shortesttransformat...原创 2019-11-18 23:28:05 · 159 阅读 · 0 评论 -
LeetCode Top Interview Questions 122. Best Time to Buy and Sell Stock II (Java版; Easy)
welcome to my blogLeetCode Top Interview Questions 122. Best Time to Buy and Sell Stock II (Java版; Easy)题目描述Say you have an array for which the ith element is the price of a given stock on day i....原创 2019-11-17 21:04:54 · 116 阅读 · 0 评论 -
LeetCode Top Interview Questions 125. Valid Palindrome (Java版; Easy)
welcome to my blogLeetCode Top Interview Questions 125. Valid Palindrome (Java版; Easy)题目描述Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring case...原创 2019-11-16 21:45:26 · 123 阅读 · 0 评论 -
LeetCode Top Interview Questions 118. Pascal's Triangle (Java版; Easy)
welcome to my blogLeetCode Top Interview Questions 118. Pascal’s Triangle (Java版; Easy)题目描述Given a non-negative integer numRows, generate the first numRows of Pascal's triangle.In Pascal's trian...原创 2019-11-15 14:58:39 · 113 阅读 · 0 评论 -
LeetCode Top Interview Questions 116. Populating Next Right Pointers in Each Node (Java版; Medium)
welcome to my blogLeetCode Top Interview Questions 116. Populating Next Right Pointers in Each Node (Java版; Medium)题目描述You are given a perfect binary tree where all leaves are on the same level, an...原创 2019-11-15 11:09:01 · 103 阅读 · 1 评论 -
LeetCode Top Interview Questions 108. Convert Sorted Array to Binary Search Tree (Java版; Easy)
welcome to my blogLeetCode Top Interview Questions 108. Convert Sorted Array to Binary Search Tree (Java版; Easy)题目描述Given an array where elements are sorted in ascending order, convert it to a heig...原创 2019-11-15 10:23:11 · 454 阅读 · 0 评论 -
LeetCode Top Interview Questions 36. Valid Sudoku (Java版; Medium)
welcome to my blogLeetCode Top Interview Questions 36. Valid Sudoku (Java版; Medium)题目描述Determine if a 9x9 Sudoku board is valid. Only the filled cells need to be validated according to the followin...原创 2019-11-14 15:09:16 · 134 阅读 · 0 评论 -
LeetCode Top Interview Questions 103. Binary Tree Zigzag Level Order Traversal (Java版; Medium)
welcome to my blogLeetCode Top Interview Questions 103. Binary Tree Zigzag Level Order Traversal (Java版; Medium)题目描述Given a binary tree, return the zigzag level order traversal of its nodes' values...原创 2019-11-14 10:19:14 · 64 阅读 · 0 评论 -
LeetCode Top Interview Questions 91. Decode Ways (Java版; Medium)
welcome to my blogLeetCode Top Interview Questions 91. Decode Ways (Java版; Medium)题目描述A message containing letters from A-Z is being encoded to numbers using the following mapping:'A' -> 1'B'...原创 2019-11-14 09:35:00 · 162 阅读 · 0 评论 -
LeetCode Top Interview Questions 88. Merge Sorted Array (Java版; Easy)
welcome to my blogLeetCode Top Interview Questions 88. Merge Sorted Array (Java版; Easy)题目描述Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array.Note:The n...原创 2019-11-13 23:07:14 · 154 阅读 · 0 评论 -
LeetCode Top Interview Questions 69. Sqrt(x) (Java版; Easy)
welcome to my blogLeetCode Top Interview Questions 69. Sqrt(x) (Java版; Easy)题目描述Implement int sqrt(int x).Compute and return the square root of x, where x is guaranteed to be a non-negative integ...原创 2019-11-13 09:23:17 · 118 阅读 · 0 评论 -
LeetCode Top Interview Questions 66. Plus One (Java版; Easy)
welcome to my blogLeetCode Top Interview Questions 66. Plus One (Java版; Easy)题目描述Given a non-empty array of digits representing a non-negative integer, plus one to the integer.The digits are stor...原创 2019-11-11 09:41:08 · 113 阅读 · 0 评论 -
LeetCode Top Interview Questions 54. Spiral Matrix (Java版; Medium)
welcome to my blogLeetCode Top Interview Questions 66. Plus One (Java版; Easy)题目描述Given a non-empty array of digits representing a non-negative integer, plus one to the integer.The digits are stor...原创 2019-11-10 23:54:39 · 76 阅读 · 0 评论