上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 44 下一页
摘要: 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 阅读(5787) 评论(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 阅读(4685) 评论(2) 推荐(0) 编辑
摘要: 在3D Slicer中,我们如果想在自己写的插件中来修改默认的鼠标响应事件的话,就需要先将原有的响应事件链接删除,然后建立自定义的响应事件链接,然后将自己要实现的功能写在响应事件函数中。 比如Slicer中默认的鼠标左键拖拽,是任意旋转视图中的Camera,默认中的滑轮操作是拉远和拉近视图摄像机,默 阅读全文
posted @ 2017-05-20 00:52 Grandyang 阅读(1277) 评论(0) 推荐(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 阅读(11600) 评论(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 阅读(8818) 评论(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 阅读(8848) 评论(2) 推荐(0) 编辑
摘要: 二分查找法作为一种常见的查找方法,将原本是线性时间提升到了对数时间范围,大大缩短了搜索时间,具有很大的应用场景,而在 LeetCode 中,要运用二分搜索法来解的题目也有很多,但是实际上二分查找法的查找目标有很多种,而且在细节写法也有一些变化。之前有网友留言希望博主能针对二分查找法的具体写法做个总结 阅读全文
posted @ 2017-05-15 08:40 Grandyang 阅读(52901) 评论(32) 推荐(6) 编辑
摘要: 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 阅读(8739) 评论(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 阅读(12887) 评论(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 阅读(4820) 评论(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 阅读(12297) 评论(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 阅读(12743) 评论(0) 推荐(1) 编辑
摘要: During the NBA playoffs, we always arrange the rather strong team to play with the rather weak team, like make the rank 1 team play with the rank nth  阅读全文
posted @ 2017-05-08 22:48 Grandyang 阅读(5539) 评论(0) 推荐(0) 编辑
摘要: Given an array of n distinct non-empty strings, you need to generate minimal possible abbreviations for every word following rules below. Example: Not 阅读全文
posted @ 2017-05-06 21:37 Grandyang 阅读(9410) 评论(6) 推荐(0) 编辑
摘要: Given two strings s1 and s2, write a function to return true if s2 contains the permutation of s1. In other words, one of the first string's permutati 阅读全文
posted @ 2017-05-05 22:45 Grandyang 阅读(12244) 评论(1) 推荐(0) 编辑
摘要: Given an array of integers and an integer k, you need to find the total number of continuous subarrays whose sum equals to k. Example 1: Input:nums = 阅读全文
posted @ 2017-05-04 22:46 Grandyang 阅读(25740) 评论(9) 推荐(1) 编辑
摘要: In MATLAB, there is a very useful function called 'reshape', which can reshape a matrix into a new one with different size but keep its original data. 阅读全文
posted @ 2017-05-03 23:22 Grandyang 阅读(6107) 评论(3) 推荐(0) 编辑
摘要: You need to construct a binary tree from a string consisting of parenthesis and integers. The whole input represents a binary tree. It contains an int 阅读全文
posted @ 2017-05-01 23:52 Grandyang 阅读(10697) 评论(7) 推荐(1) 编辑
摘要: Suppose LeetCode will start its IPO soon. In order to sell a good price of its shares to Venture Capital, LeetCode would like to work on some projects 阅读全文
posted @ 2017-04-30 08:47 Grandyang 阅读(4635) 评论(1) 推荐(2) 编辑
摘要: Given a binary tree, return the tilt of the whole tree. The tilt of a tree node is defined as the absolute difference between the sum of all left subt 阅读全文
posted @ 2017-04-29 23:49 Grandyang 阅读(5668) 评论(0) 推荐(0) 编辑
摘要: Given an array of 2n integers, your task is to group these integers into n pairs of integer, say (a1, b1), (a2, b2), ..., (an, bn) which makes sum of 阅读全文
posted @ 2017-04-27 23:57 Grandyang 阅读(9696) 评论(0) 推荐(0) 编辑
摘要: Think about Zuma Game. You have a row of balls on the table, colored red(R), yellow(Y), blue(B), green(G), and white(W). You also have several balls i 阅读全文
posted @ 2017-04-25 00:01 Grandyang 阅读(9200) 评论(2) 推荐(0) 编辑
摘要: Given a picture consisting of black and white pixels, and a positive integer N, find the number of black pixels located at some specific row R and col 阅读全文
posted @ 2017-04-24 02:26 Grandyang 阅读(6122) 评论(0) 推荐(0) 编辑
摘要: Given a picture consisting of black and white pixels, find the number of black lonely pixels. The picture is represented by a 2D char array consisting 阅读全文
posted @ 2017-04-23 22:43 Grandyang 阅读(5844) 评论(0) 推荐(0) 编辑
摘要: There is a ball in a maze with empty spaces and walls. The ball can go through empty spaces by rolling up (u), down (d), left (l) or right (r), but it 阅读全文
posted @ 2017-04-21 23:24 Grandyang 阅读(9940) 评论(0) 推荐(0) 编辑
摘要: You are given a string representing an attendance record for a student. The record only contains the following three characters: A student could be re 阅读全文
posted @ 2017-04-19 23:23 Grandyang 阅读(4734) 评论(0) 推荐(0) 编辑
摘要: 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-04-17 22:58 Grandyang 阅读(17417) 评论(24) 推荐(0) 编辑
摘要: Given a positive 32-bit integer n, you need to find the smallest 32-bit integer which has exactly the same digits existing in the integer n and is gre 阅读全文
posted @ 2017-04-15 22:43 Grandyang 阅读(9561) 评论(1) 推荐(1) 编辑
摘要: Given a string, you need to reverse the order of characters in each word within a sentence while still preserving whitespace and initial word order. E 阅读全文
posted @ 2017-04-13 12:17 Grandyang 阅读(7047) 评论(0) 推荐(0) 编辑
摘要: There is a brick wall in front of you. The wall is rectangular and has several rows of bricks. The bricks have the same height but different width. Yo 阅读全文
posted @ 2017-04-11 23:56 Grandyang 阅读(5753) 评论(8) 推荐(1) 编辑
摘要: There are N students in a class. Some of them are friends, while some are not. Their friendship is transitive in nature. For example, if A is a direct 阅读全文
posted @ 2017-04-09 23:05 Grandyang 阅读(21477) 评论(7) 推荐(0) 编辑
摘要: Given a list of strings, you need to find the longest uncommon subsequence among them. The longest uncommon subsequence is defined as the longest subs 阅读全文
posted @ 2017-04-07 23:38 Grandyang 阅读(8209) 评论(2) 推荐(1) 编辑
摘要: In the video game Fallout 4, the quest "Road to Freedom" requires players to reach a metal dial called the "Freedom Trail Ring", and use the dial to s 阅读全文
posted @ 2017-04-06 22:52 Grandyang 阅读(5920) 评论(7) 推荐(0) 编辑
摘要: Given a group of two strings, you need to find the longest uncommon subsequence of this group of two strings. The longest uncommon subsequence is defi 阅读全文
posted @ 2017-04-04 22:47 Grandyang 阅读(7414) 评论(5) 推荐(0) 编辑
摘要: Given two strings representing two complex numbers. You need to return a string representing their multiplication. Note i2 = -1 according to the defin 阅读全文
posted @ 2017-04-03 01:18 Grandyang 阅读(3497) 评论(0) 推荐(1) 编辑
摘要: Given an array nums, we call (i, j) an important reverse pair if i < j and nums[i] > 2*nums[j]. You need to return the number of important reverse pai 阅读全文
posted @ 2017-04-02 00:00 Grandyang 阅读(19060) 评论(11) 推荐(0) 编辑
摘要: You have n super washing machines on a line. Initially, each washing machine has some dresses or is empty. For each move, you could choose any m (1 ≤ 阅读全文
posted @ 2017-03-30 21:12 Grandyang 阅读(7215) 评论(6) 推荐(0) 编辑
摘要: We define the Perfect Number is a positive integer that is equal to the sum of all its positive divisors except itself. Now, given an integer n, write 阅读全文
posted @ 2017-03-28 21:07 Grandyang 阅读(7641) 评论(4) 推荐(0) 编辑
摘要: 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 阅读(6674) 评论(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 阅读(14390) 评论(1) 推荐(0) 编辑
上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 44 下一页
Fork me on GitHub