随笔分类 -  LeetCode

上一页 1 ··· 30 31 32 33 34 35 36 37 38 ··· 61 下一页
摘要:Given a string representing an expression of fraction addition and subtraction, you need to return the calculation result in string format. The final 阅读全文
posted @ 2017-06-06 23:30 Grandyang 阅读(4227) 评论(0) 推荐(0)
摘要:Design an in-memory file system to simulate the following functions: ls: Given a path in string format. If it is a file path, return a list that only 阅读全文
posted @ 2017-06-05 12:32 Grandyang 阅读(14173) 评论(1) 推荐(0)
摘要:You are given an integer array nums of length n where nums is a permutation of the numbers in the range [0, n - 1]. You should build a set s[k] = {num 阅读全文
posted @ 2017-06-02 12:45 Grandyang 阅读(6435) 评论(16) 推荐(0)
摘要:There is an m by n grid with a ball. Given the start coordinate (i,j) of the ball, you can move the ball to adjacent cell or cross the grid boundary i 阅读全文
posted @ 2017-06-01 11:14 Grandyang 阅读(7464) 评论(5) 推荐(0)
摘要:There's a tree, a squirrel, and several nuts. Positions are represented by the cells in a 2D grid. Your goal is to find the minimal distance for the s 阅读全文
posted @ 2017-05-30 10:52 Grandyang 阅读(3449) 评论(0) 推荐(0)
摘要:LeetCode wants to give one of its best employees the option to travel among N cities to collect algorithm problems. But all work and no play makes Jac 阅读全文
posted @ 2017-05-29 23:58 Grandyang 阅读(9344) 评论(13) 推荐(0)
摘要:Given an integer n, find the closest integer (not including itself), which is a palindrome. The 'closest' is defined as absolute difference minimized 阅读全文
posted @ 2017-05-28 11:30 Grandyang 阅读(8300) 评论(1) 推荐(0)
摘要:Given the coordinates of four points in 2D space, return whether the four points could construct a square. The coordinate (x,y) of a point is represen 阅读全文
posted @ 2017-05-27 23:33 Grandyang 阅读(5889) 评论(2) 推荐(0)
摘要:Given a 01 matrix M, find the longest line of consecutive one in the matrix. The line could be horizontal, vertical, diagonal or anti-diagonal. Exampl 阅读全文
posted @ 2017-05-24 20:35 Grandyang 阅读(8398) 评论(3) 推荐(0)
摘要:We define a harmonious array is an array where the difference between its maximum value and its minimum value is exactly 1. Now, given an integer arra 阅读全文
posted @ 2017-05-23 23:33 Grandyang 阅读(5903) 评论(2) 推荐(0)
摘要:Given a list of strings, you could concatenate these strings together into a loop, where for each string you could choose to reverse it or not. Among 阅读全文
posted @ 2017-05-22 01:39 Grandyang 阅读(5830) 评论(0) 推荐(1)
摘要:Given a list of positive integers, the adjacent integers will perform the float division. For example, [2,3,4] -> 2 / 3 / 4. However, you can add any 阅读全文
posted @ 2017-05-21 23:44 Grandyang 阅读(4731) 评论(2) 推荐(0)
摘要:Given an integer array nums, you need to find one continuous subarray that if you only sort this subarray in ascending order, then the whole array wil 阅读全文
posted @ 2017-05-19 06:21 Grandyang 阅读(11691) 评论(6) 推荐(1)
摘要:Given a positive integer n, return the number of all possible attendance records with length n, which will be regarded as rewardable. The answer may b 阅读全文
posted @ 2017-05-17 11:41 Grandyang 阅读(8907) 评论(7) 推荐(0)
摘要:Given a binary tree, you need to find the length of Longest Consecutive Path in Binary Tree. Especially, this path can be either increasing or decreas 阅读全文
posted @ 2017-05-16 23:56 Grandyang 阅读(8895) 评论(2) 推荐(0)
摘要:Given an array with n integers, you need to find if there are triplets (i, j, k) which satisfies following conditions: where we define that subarray ( 阅读全文
posted @ 2017-05-14 23:43 Grandyang 阅读(8805) 评论(7) 推荐(0)
摘要:You are given several boxes with different colors represented by different positive numbers. You may experience several rounds to remove boxes until t 阅读全文
posted @ 2017-05-13 22:16 Grandyang 阅读(13020) 评论(7) 推荐(1)
摘要:Given an integer array with even length, where different numbers in this array represent different kinds of candies. Each number means one candy of th 阅读全文
posted @ 2017-05-12 23:34 Grandyang 阅读(4872) 评论(1) 推荐(0)
摘要:Given a binary tree, return the values of its boundary in anti-clockwise direction starting from root. Boundary includes left boundary, leaves, and ri 阅读全文
posted @ 2017-05-10 00:17 Grandyang 阅读(12401) 评论(1) 推荐(0)
摘要:Given two non-empty binary trees s and t, check whether tree t has exactly the same structure and node values with a subtree of s. A subtree of s is a 阅读全文
posted @ 2017-05-09 01:01 Grandyang 阅读(12927) 评论(0) 推荐(1)

上一页 1 ··· 30 31 32 33 34 35 36 37 38 ··· 61 下一页
Fork me on GitHub