- 博客(17)
- 收藏
- 关注
原创 【LeetCode】59. Spiral Matrix II
Given a positive integer n, generate a square matrix filled with elements from 1 to n2 in spiral order.Example:Input: 3 Output: [ [ 1, 2, 3 ], [ 8, 9, 4 ], [ 7, 6, 5 ] ]输入数字n,然后按照螺旋形从1开始输出一个n*n矩阵。这...
2018-05-31 09:52:01 166
原创 【LeetCode】56. Merge Intervals
Given a collection of intervals, merge all overlapping intervals.Example 1:Input: [[1,3],[2,6],[8,10],[15,18]] Output: [[1,6],[8,10],[15,18]] Explanation: Since intervals [1,3] and [2,6] overlaps, mer...
2018-05-30 14:54:00 131
原创 【LeetCode】55. Jump Game
Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximum jump length at that position.Determine if you ar...
2018-05-27 17:19:14 130
原创 【LeetCode】50. Pow(x, n)
Implement pow(x, n), which calculates x raised to the power n (xn).Example 1:Input: 2.00000, 10 Output: 1024.00000 Example 2:Input: 2.10000, 3 Output: 9.26100 Example 3:Input: 2.00000, -2 Output: 0.25...
2018-05-24 16:23:14 258
原创 【LeetCode】54. Spiral Matrix
Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order.Example 1:Input: [ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ] ] Output: [1,2,3,6,9,8,7,4,5] Exampl...
2018-05-24 16:12:36 122
原创 TensorFlow使用中遇到的错误(更新中)
1.python premade_estimator.py出错错误描述Traceback (most recent call last): File "premade_estimator.py", line 22, in <module> import iris_data File "/home/fboy/tensorflow_code/models/samples/...
2018-05-22 21:51:29 1347
原创 【LeetCode】49. Group Anagrams
Given an array of strings, group anagrams together.Example:Input: ["eat", "tea", "tan", "ate", "nat", "bat"]Output: [ ["ate","eat","tea"], ["nat","
2018-05-22 16:20:20 117
原创 【LeetCode】40. Combination Sum II
Given a collection of candidate numbers (candidates) and a target number (target), find all unique combinations in candidates where the candidate numbers sums to target.Each number in candidates may o...
2018-05-20 17:05:02 120
原创 【LeetCode】39. Combination Sum
Given a set of candidate numbers (candidates) (without duplicates) and a target number (target), find all unique combinations in candidates where the candidate numbers sums to target.The same repeated...
2018-05-20 11:30:35 109
原创 【LeetCode】18. 4Sum
Given an array nums of n integers and an integer target, are there elements a, b, c, and d in nums such that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum of tar...
2018-05-20 11:17:49 159
原创 【LeetCode】43. Multiply Strings
Given two non-negative integers num1 and num2 represented as strings, return the product of num1 and num2, also represented as a string.Example 1:Input: num1 = "2", num2 = "3" Output: "6"Example 2:Inp...
2018-05-17 19:01:06 206
原创 【LeetCode】48. Rotate Image
You are given an n x n 2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Note:You have to rotate the image in-place, which means you have to modify the input 2D matrix directl...
2018-05-16 11:43:10 93
原创 【LeetCode】22. Generate Parentheses
Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, given n = 3, a solution set is:[ "((()))", "(()())", "(())()", "()(())", "...
2018-05-14 16:42:12 165
原创 【LeetCode】46. Permutations
Given a collection of distinct integers, return all possible permutations.Example:Input: [1,2,3] Output: [ [1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], [3,2,1] ]给出一串数字,没有重复数字,返回它的所有排列。这道题跟...
2018-05-14 16:28:31 100
原创 【LeetCode】34. Search for a Range
Given an array of integers nums sorted in ascending order, find the starting and ending position of a given target value.Your algorithm's runtime complexity must be in the order of O(log n).If the tar...
2018-05-05 16:30:58 141
原创 【LeetCode】33. Search in Rotated Sorted Array
Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand.(i.e., [0,1,2,4,5,6,7] might become [4,5,6,7,0,1,2]).You are given a target value to search. If found in t...
2018-05-05 15:59:12 102
原创 【LeetCode】31. Next Permutation
Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not possible, it must rearrange it as the lowest possible ord...
2018-05-05 12:33:01 176
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人