- 博客(10)
- 收藏
- 关注
原创 [LeetCode刷题日记(Day25)]:Course Schedule
Problem 207. Course Schedule题目描述There are a total of n courses you have to take, labeled from 0 to n-1.Some courses may have prerequisites, for example to take course 0 you have to first take cou...
2019-04-11 12:55:55 204
原创 [LeetCode刷题日记(Day24)]:Evaluate Reverse Polish Notation
Problem 150. Evaluate Reverse Polish Notation题目描述Evaluate the value of an arithmetic expression in Reverse Polish Notation.Valid operators are +, -, *, /. Each operand may be an integer or anothe...
2019-04-05 17:47:30 221
原创 [LeetCode刷题日记(Day24)]:Word Break
Problem 139. Word Break题目描述Given a non-empty string s and a dictionary wordDict containing a list of non-empty words, determine if s can be segmented into a space-separated sequence of one or more...
2019-04-05 16:59:09 130
原创 [LeetCode刷题日记(Day24)]:Gas Station
Problem 134. Gas Station题目描述There are N gas stations along a circular route, where the amount of gas at station i is gas[i].You have a car with an unlimited gas tank and it costs cost[i] of gas t...
2019-04-05 16:01:31 121
原创 [LeetCode刷题日记(Day24)]:Palindrome Partitioning
Problem 131. Palindrome Partitioning题目描述Given a string s, partition s such that every substring of the partition is a palindrome.Return all possible palindrome partitioning of s.Example:Input: ...
2019-04-05 15:26:48 157
原创 [LeetCode刷题日记(Day23)]:Binary Tree Level Order Traversal
Problem 102. Binary Tree Level Order Traversal题目描述Given a binary tree, return the level order traversal of its nodes’ values. (ie, from left to right, level by level).For example:Given binary tr...
2019-04-04 13:48:39 139
原创 [LeetCode刷题日记(Day23)]:Validate Binary Search Tree
Problem 98. Validate Binary Search Tree题目描述Given a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined as follows:The left subtree of a node contains only n...
2019-04-04 13:04:54 139
原创 LeetCode刷题日记(Day22)
Problem 242. Valid Anagram题目描述Given two strings s and t , write a function to determine if t is an anagram of s.Example:Input: s = "anagram", t = "nagaram"Output: true解题思路要判断一个字符串是否由另一个字符串...
2019-04-03 13:10:46 232
原创 LeetCode刷题日记(Day21)
Problem 234. Palindrome Linked List题目描述Given a singly linked list, determine if it is a palindrome.Example:Input: 1->2->2->1Output: true解题思路要判断一个链表是否是回文链表,且要求时间复杂度和空间复杂度分别为 O(n) 和...
2019-04-02 15:22:29 129
原创 LeetCode刷题日记(Day20)
Problem 202. Happy Number题目描述Write an algorithm to determine if a number is “happy”.A happy number is a number defined by the following process: Starting with any positive integer, replace the nu...
2019-04-01 20:45:16 156
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人