随笔分类 -  刷题笔记

1 2 3 下一页

LeetCode第[98]题(Java):Validate Binary Search Tree(验证二叉搜索树)
摘要:题目:验证二叉搜索树 难度:Medium 题目内容: Given a binary tree, determine if it is a valid binary search tree (BST). Assume a BST is defined as follows: The left subt 阅读全文

posted @ 2018-05-30 17:00 清风吹斜阳 阅读(2326) 评论(1) 推荐(1)

LeetCode第[91]题(Java):Decode Ways(解码方法数)
摘要:题目:解码方法数 难度:Medium 题目内容: A message containing letters from A-Z is being encoded to numbers using the following mapping: 'A' -> 1 'B' -> 2 ... 'Z' -> 2 阅读全文

posted @ 2018-05-30 00:08 清风吹斜阳 阅读(1935) 评论(0) 推荐(0)

LeetCode第[88]题(Java):Merge Sorted Array(合并已排序数组)
摘要:题目:合并已排序数组 难度:Easy 题目内容: Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array. 翻译: 给定两个排序的整数数组nums1和nums2,将nums 阅读全文

posted @ 2018-05-29 00:18 清风吹斜阳 阅读(872) 评论(0) 推荐(0)

LeetCode第[84]题(Java):Largest Rectangle in Histogram(最大的矩形柱状图)
摘要:题目:最大的矩形柱状图 难度:hard 题目内容: Given n non-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of lar 阅读全文

posted @ 2018-05-28 18:15 清风吹斜阳 阅读(733) 评论(0) 推荐(0)

LeetCode第[79]题(Java):Word Search(矩阵单词搜索)
摘要:题目:矩阵单词搜索 难度:Medium 题目内容: Given a 2D board and a word, find if the word exists in the grid. The word can be constructed from letters of sequentially a 阅读全文

posted @ 2018-05-26 00:33 清风吹斜阳 阅读(645) 评论(0) 推荐(0)

LeetCode第[78]题(Java):Subsets(求子集)扩展——第[90]题:Subsets 2
摘要:题目:矩阵置0 难度:Easy 题目内容: Given a set of distinct integers, nums, return all possible subsets (the power set). Note: The solution set must not contain dup 阅读全文

posted @ 2018-05-23 18:09 清风吹斜阳 阅读(1417) 评论(1) 推荐(0)

LeetCode第[73]题(Java):Set Matrix Zeroes(矩阵置0)
摘要:题目:矩阵置0 难度:Easy 题目内容: Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in-place. Given a m x n matrix, if an elemen 阅读全文

posted @ 2018-05-20 23:58 清风吹斜阳 阅读(472) 评论(0) 推荐(0)

LeetCode第[69]题(Java):Sqrt(x)
摘要:题目:求平方根 难度:Easy 题目内容: Compute and return the square root of x, where x is guaranteed to be a non-negative integer. Since the return type is an integer 阅读全文

posted @ 2018-05-19 23:42 清风吹斜阳 阅读(401) 评论(0) 推荐(0)

LeetCode第[66]题(Java):Plus One
摘要:题目:数组加一 难度:Easy 题目内容: Given a non-empty array of digits representing a non-negative integer, plus one to the integer. The digits are stored such that 阅读全文

posted @ 2018-05-18 11:46 清风吹斜阳 阅读(814) 评论(0) 推荐(0)

LeetCode第[62]题(Java):Unique Paths 及扩展
摘要:题目:唯一路径(机器人走方格) 难度:Medium 题目内容: A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below). The robot can only mo 阅读全文

posted @ 2018-05-14 23:50 清风吹斜阳 阅读(307) 评论(0) 推荐(0)

LeetCode第[56]题(Java):Merge Intervals
摘要:题目:合并区间 难度:Medium 题目内容: Given a collection of intervals, merge all overlapping intervals. Given a collection of intervals, merge all overlapping inter 阅读全文

posted @ 2018-05-14 00:14 清风吹斜阳 阅读(301) 评论(0) 推荐(0)

LeetCode第[55]题(Java):Jump Game
摘要:题目:跳跳游戏 难度:Medium 题目内容: Given an array of non-negative integers, you are initially positioned at the first index of the array. Each element in the arr 阅读全文

posted @ 2018-05-13 19:09 清风吹斜阳 阅读(394) 评论(0) 推荐(0)

LeetCode第[54]题(Java):Spiral Matrix
摘要:题目:螺旋矩阵 难度:Medium 题目内容: Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order. 翻译: 给定一个m x n元素的矩阵(m行 阅读全文

posted @ 2018-05-13 17:23 清风吹斜阳 阅读(476) 评论(0) 推荐(0)

LeetCode第[53]题(Java):Maximum Subarray
摘要:题目:和最大的子序列 难度:Medium 题目内容: Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and re 阅读全文

posted @ 2018-05-13 00:01 清风吹斜阳 阅读(969) 评论(0) 推荐(0)

LeetCode第[50]题(Java):Pow(x, n)
摘要:题目:求x的n次幂 难度:Medium 题目内容: Implement pow(x, n), which calculates x raised to the power n (xn). 翻译: 实现计算x的n次幂。 Example 1: Example 2: Example 3: Note: -1 阅读全文

posted @ 2018-05-12 12:29 清风吹斜阳 阅读(1029) 评论(0) 推荐(0)

LeetCode第[49]题(Java):Group Anagrams
摘要:题目:同字符分组 难度:Medium 题目内容: Given an array of strings, group anagrams together. 翻译:给定一组字符串数组,按相同字符组成的字符串分为一组。 Example: 我的思路:因为要分组,那么使用map即可,相同的字符作为键,值为一个 阅读全文

posted @ 2018-05-11 22:19 清风吹斜阳 阅读(405) 评论(0) 推荐(0)

LeetCode第[46]题(Java):Permutations(求所有全排列) 含扩展——第[47]题Permutations 2
摘要:题目:求所有全排列 难度:Medium 题目内容: Given a collection of distinct integers, return all possible permutations. 翻译:给定一组各不相同的整数,返回所有可能的排列。 Example: 我的思路:每种情况中,每一个 阅读全文

posted @ 2018-05-10 23:09 清风吹斜阳 阅读(429) 评论(0) 推荐(0)

LeetCode第[48]题(Java):Rotate Image
摘要:题目:矩阵旋转 难度:Medium 题目内容: You are given an n x n 2D matrix representing an image. Rotate the image by 90 degrees (clockwise). Note: You have to rotate t 阅读全文

posted @ 2018-05-10 00:00 清风吹斜阳 阅读(873) 评论(0) 推荐(0)

LeetCode第[44]题(Java):Wildcard Matching
摘要:题目:通配符匹配 难度:hard 题目内容: Given an input string (s) and a pattern (p), implement wildcard pattern matching with support for '?' and '*'. The matching sho 阅读全文

posted @ 2018-05-08 17:04 清风吹斜阳 阅读(715) 评论(0) 推荐(0)

LeetCode第[42]题(Java):Trapping Rain Water (数组方块盛水)——HARD
摘要:题目:接雨水 难度:hard 题目内容: Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able t 阅读全文

posted @ 2018-05-07 23:46 清风吹斜阳 阅读(587) 评论(0) 推荐(0)

1 2 3 下一页

导航