上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 44 下一页
摘要: For an integer n, we call k>=2 a good base of n, if all digits of n base k are 1. Now given a string representing n, you should return the smallest go 阅读全文
posted @ 2017-03-26 06:08 Grandyang 阅读(6689) 评论(3) 推荐(0) 编辑
摘要: Median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value. So the median is the mean of the two 阅读全文
posted @ 2017-03-26 06:05 Grandyang 阅读(14457) 评论(1) 推荐(0) 编辑
摘要: Given a binary tree, you need to compute the length of the diameter of the tree. The diameter of a binary tree is the length of the longestpath betwee 阅读全文
posted @ 2017-03-23 21:03 Grandyang 阅读(17823) 评论(12) 推荐(0) 编辑
摘要: Given an m x n binary matrix mat, return the distance of the nearest 0 for each cell. The distance between two adjacent cells is 1. Example 1: Input: 阅读全文
posted @ 2017-03-22 21:49 Grandyang 阅读(19468) 评论(10) 推荐(2) 编辑
摘要: Given the root of a Binary Search Tree (BST), convert it to a Greater Tree such that every key of the original BST is changed to the original key plus 阅读全文
posted @ 2017-03-20 20:49 Grandyang 阅读(10492) 评论(7) 推荐(1) 编辑
摘要: Given a string and an integer k, you need to reverse the first k characters for every 2k characters counting from the start of the string. If there ar 阅读全文
posted @ 2017-03-19 23:22 Grandyang 阅读(8119) 评论(0) 推荐(0) 编辑
摘要: Given a list of 24-hour clock time points in "Hour:Minutes" format, find the minimum minutes difference between any two time points in the list. Examp 阅读全文
posted @ 2017-03-17 21:20 Grandyang 阅读(5883) 评论(4) 推荐(0) 编辑
摘要: TinyURL is a URL shortening service where you enter a URL such as https://leetcode.com/problems/design-tinyurl and it returns a short URL such as http 阅读全文
posted @ 2017-03-16 23:14 Grandyang 阅读(11167) 评论(7) 推荐(0) 编辑
摘要: 我之前有一篇博客Convert PLY to VTK Using PCL 1.6.0 or PCL 1.8.0 使用PCL库将PLY格式转为VTK格式展示了如何将PLY格式文件转化为VTK格式的文件,在文章的最后提到了VTK文件保存纹理的两种方式,第一种是需要有texture的图片,然后每个点存储上 阅读全文
posted @ 2017-03-14 09:06 Grandyang 阅读(2618) 评论(0) 推荐(0) 编辑
摘要: When use function 'pcl::io::vtkPolyDataToPointCloud' in PCL 1.6.0, one may have error as follows: This happens because function 'pcl::io::vtkPolyDataT 阅读全文
posted @ 2017-03-14 03:19 Grandyang 阅读(889) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers and an integer k, you need to find the number of unique k-diff pairs in the array. Here a k-diff pair is defined as an inte 阅读全文
posted @ 2017-03-13 21:10 Grandyang 阅读(11182) 评论(2) 推荐(0) 编辑
摘要: Given a binary search tree with non-negative values, find the minimum absolute difference between values of any two nodes. Example: Note: There are at 阅读全文
posted @ 2017-03-12 23:17 Grandyang 阅读(8664) 评论(2) 推荐(0) 编辑
摘要: Let's play the minesweeper game (Wikipedia, online game)! You are given a 2D char matrix representing the game board. 'M' represents an unrevealed min 阅读全文
posted @ 2017-03-11 23:41 Grandyang 阅读(9863) 评论(3) 推荐(2) 编辑
摘要: Suppose you have N integers from 1 to N. We define a beautiful arrangement as an array that is constructed by these N numbers successfully if one of t 阅读全文
posted @ 2017-03-10 21:57 Grandyang 阅读(10431) 评论(1) 推荐(2) 编辑
摘要: Given a binary array, find the maximum length of a contiguous subarray with equal number of 0 and 1. Example 1: Input: [0,1] Output: 2 Explanation: [0 阅读全文
posted @ 2017-03-10 11:41 Grandyang 阅读(12542) 评论(5) 推荐(0) 编辑
摘要: Given a string s and a string array dictionary, return the longest string in the dictionary that can be formed by deleting some of the given string ch 阅读全文
posted @ 2017-03-08 22:08 Grandyang 阅读(8213) 评论(3) 推荐(0) 编辑
摘要: 花了将近一周的时间的,终于在VS2010成功的编译了最新版的3D Slicer 4.7.0,感觉快要崩溃了。Slicer用了20多个外部的库,全都要一起编译,完整编译一次起码要七八个小时,光VS的Output输出窗口有十万多行,复制到txt中,文本内容居然有26MB之多,可怕!经过台式机和笔记本分别 阅读全文
posted @ 2017-03-08 05:35 Grandyang 阅读(2207) 评论(8) 推荐(0) 编辑
摘要: Given a word, you need to judge whether the usage of capitals in it is right or not. We define the usage of capitals in a word to be right when one of 阅读全文
posted @ 2017-03-07 08:54 Grandyang 阅读(4801) 评论(0) 推荐(0) 编辑
摘要: Given an integer array nums and an integer k, return true if nums has a continuous subarray of size at least two whose elements sum up to a multiple o 阅读全文
posted @ 2017-03-05 08:25 Grandyang 阅读(17640) 评论(7) 推荐(2) 编辑
摘要: Given a string s, find the longest palindromic subsequence's length in s. You may assume that the maximum length of s is 1000. Example 1:Input: "bbbab 阅读全文
posted @ 2017-03-02 23:30 Grandyang 阅读(19925) 评论(7) 推荐(1) 编辑
摘要: Given the root of a tree, you are asked to find the most frequent subtree sum. The subtree sum of a node is defined as the sum of all the node values 阅读全文
posted @ 2017-02-28 23:43 Grandyang 阅读(6523) 评论(1) 推荐(1) 编辑
摘要: Given scores of N athletes, find their relative ranks and the people with the top three highest scores, who will be awarded medals: "Gold Medal", "Sil 阅读全文
posted @ 2017-02-27 23:34 Grandyang 阅读(5486) 评论(0) 推荐(0) 编辑
摘要: Given a circular array (the next element of the last element is the first element of the array), print the Next Greater Number for every element. The 阅读全文
posted @ 2017-02-25 21:12 Grandyang 阅读(11240) 评论(0) 推荐(0) 编辑
摘要: Given a binary search tree (BST) with duplicates, find all the mode(s) (the most frequently occurred element) in the given BST. Assume a BST is define 阅读全文
posted @ 2017-02-23 23:45 Grandyang 阅读(12853) 评论(8) 推荐(2) 编辑
摘要: Given a List of words, return the words that can be typed using letters of alphabet on only one row's of American keyboard like the image below. Examp 阅读全文
posted @ 2017-02-20 21:55 Grandyang 阅读(6747) 评论(2) 推荐(0) 编辑
摘要: Given an integer, return its base 7 string representation. Example 1: Example 2: Note: The input will be in range of [-1e7, 1e7]. 这道题给了我们一个数,让我们转为七进制的 阅读全文
posted @ 2017-02-20 00:09 Grandyang 阅读(6939) 评论(2) 推荐(0) 编辑
摘要: You need to find the largest value in each row of a binary tree. Example: 这道题让我们找二叉树每行的最大的结点值,那么实际上最直接的方法就是用层序遍历,然后在每一层中找到最大值,加入结果res中即可,参见代码如下: 解法一: 阅读全文
posted @ 2017-02-19 23:29 Grandyang 阅读(4954) 评论(0) 推荐(0) 编辑
摘要: Given a matrix of M x N elements (M rows, N columns), return all elements of the matrix in diagonal order as shown in the below image. Example: Note: 阅读全文
posted @ 2017-02-18 23:13 Grandyang 阅读(13456) 评论(1) 推荐(0) 编辑
摘要: Given a binary tree, find the leftmost value in the last row of the tree. Example 1: Example 2: Note: You may assume the tree (i.e., the given root no 阅读全文
posted @ 2017-02-16 12:28 Grandyang 阅读(7038) 评论(4) 推荐(0) 编辑
摘要: You are given two integer arrays nums1 and nums2 both of unique elements, where nums1 is a subset of nums2. Find all the next greater numbers for nums 阅读全文
posted @ 2017-02-15 03:15 Grandyang 阅读(17264) 评论(5) 推荐(1) 编辑
摘要: In LLP world, there is a hero called Teemo and his attacking can make his enemy Ashe be in poisoned condition. Now, given the Teemo's attacking ascend 阅读全文
posted @ 2017-02-14 22:01 Grandyang 阅读(4829) 评论(0) 推荐(0) 编辑
摘要: You are given a list of non-negative integers, a1, a2, ..., an, and a target, S. Now you have 2 symbols + and -. For each integer, you should choose o 阅读全文
posted @ 2017-02-13 23:21 Grandyang 阅读(20003) 评论(8) 推荐(1) 编辑
摘要: For a web developer, it is very important to know how to design a web page's size. So, given a specific rectangular web page’s area, your job by now i 阅读全文
posted @ 2017-02-11 23:57 Grandyang 阅读(3601) 评论(6) 推荐(0) 编辑
摘要: Given an integer array, your task is to find all the different possible increasing subsequences of the given array, and the length of an increasing su 阅读全文
posted @ 2017-02-10 22:11 Grandyang 阅读(9042) 评论(5) 推荐(2) 编辑
摘要: There is a ball in a maze with empty spaces and walls. The ball can go through empty spaces by rolling up, down, left or right, but it won't stop roll 阅读全文
posted @ 2017-02-09 11:57 Grandyang 阅读(26841) 评论(10) 推荐(2) 编辑
摘要: 将Qt4的项目迁到Qt5中并不需要新建一个Qt5的工程,可以直接在原工程文件上修改,这里我们使用的是VS2010和Qt5.4的环境,我们需要做以下修改: 1. 在工程里找到这个文件:工程名.vcxproj.user,将里面的Qtdir路径修改为:C:\Qt\5.4\msvc2010_opengl。我 阅读全文
posted @ 2017-02-08 00:17 Grandyang 阅读(1485) 评论(0) 推荐(0) 编辑
摘要: Given a binary array, find the maximum number of consecutive 1s in this array if you can flip at most one 0. Example 1: Input: [1,0,1,1,0] Output: 4 E 阅读全文
posted @ 2017-02-07 22:15 Grandyang 阅读(11154) 评论(2) 推荐(2) 编辑
摘要: When compile program using Visual Studio 2015, Matlab 2016b, and OpenCV 3.1.0, one might get the error as follow: Undefined function or variable ‘setI 阅读全文
posted @ 2017-02-07 02:14 Grandyang 阅读(1922) 评论(0) 推荐(0) 编辑
摘要: Given an array of scores that are non-negative integers. Player 1 picks one of the numbers from either end of the array followed by the player 2 and t 阅读全文
posted @ 2017-02-06 11:25 Grandyang 阅读(12634) 评论(4) 推荐(0) 编辑
摘要: By now, you are given a secret signature consisting of character 'D' and 'I'. 'D' represents a decreasing relationship between two numbers, 'I' repres 阅读全文
posted @ 2017-02-05 00:07 Grandyang 阅读(7383) 评论(4) 推荐(1) 编辑
上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 44 下一页
Fork me on GitHub