上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 44 下一页
摘要: On an infinite number line (x-axis), we drop given squares in the order they are given. The i-th square dropped (positions[i] = (left, side_length)) i 阅读全文
posted @ 2018-02-28 23:50 Grandyang 阅读(4757) 评论(0) 推荐(0) 编辑
摘要: We are stacking blocks to form a pyramid. Each block has a color which is a one letter string, like `'Z'`. For every block of color `C` we place not i 阅读全文
posted @ 2018-02-26 23:19 Grandyang 阅读(5295) 评论(0) 推荐(1) 编辑
摘要: We are given N different types of stickers. Each sticker has a lowercase English word on it. You would like to spell out the given target string by cu 阅读全文
posted @ 2018-02-24 23:58 Grandyang 阅读(5759) 评论(1) 推荐(0) 编辑
摘要: We are given an elevation map, heights[i] representing the height of the terrain at that index. The width at each index is 1. After V units of water f 阅读全文
posted @ 2018-02-22 23:36 Grandyang 阅读(7317) 评论(2) 推荐(0) 编辑
摘要: You are standing at position 0 on an infinite number line. There is a goal at position target. On each move, you can either go left or right. During t 阅读全文
posted @ 2018-02-20 23:44 Grandyang 阅读(6574) 评论(11) 推荐(0) 编辑
摘要: In a given array nums of positive integers, find three non-overlapping subarrays with maximum sum. Each subarray will be of size k, and we want to max 阅读全文
posted @ 2018-02-18 23:50 Grandyang 阅读(9024) 评论(6) 推荐(2) 编辑
摘要: There is a box protected by a password. The password is n digits, where each letter can be one of the first k digits 0, 1, ..., k-1. You can keep inpu 阅读全文
posted @ 2018-02-17 23:54 Grandyang 阅读(8201) 评论(11) 推荐(0) 编辑
摘要: You have a lock in front of you with 4 circular wheels. Each wheel has 10 slots: '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'. The wheels can rota 阅读全文
posted @ 2018-02-15 05:45 Grandyang 阅读(8237) 评论(4) 推荐(2) 编辑
摘要: In this problem, a rooted tree is a directed graph such that, there is exactly one node (the root) for which all other nodes are descendants of this n 阅读全文
posted @ 2018-02-12 22:29 Grandyang 阅读(9831) 评论(10) 推荐(0) 编辑
摘要: Given a start IP address ip and a number of ips we need to cover n, return a representation of the range as a list (of smallest possible length) of CI 阅读全文
posted @ 2018-02-10 23:50 Grandyang 阅读(13975) 评论(0) 推荐(0) 编辑
摘要: Given a grid where each entry is only 0 or 1, find the number of corner rectangles. A corner rectangle is 4 distinct 1s on the grid that form an axis- 阅读全文
posted @ 2018-02-08 23:34 Grandyang 阅读(8206) 评论(3) 推荐(1) 编辑
摘要: A virus is spreading rapidly, and your task is to quarantine the infected area by installing walls. The world is modeled as a 2-D array of cells, wher 阅读全文
posted @ 2018-02-06 23:49 Grandyang 阅读(3542) 评论(0) 推荐(0) 编辑
摘要: You have N bulbs in a row numbered from 1 to N. Initially, all the bulbs are turned off. We turn on exactly one bulb everyday until all bulbs are on a 阅读全文
posted @ 2018-02-05 02:47 Grandyang 阅读(8601) 评论(3) 推荐(0) 编辑
摘要: Find the minimum length word from a given dictionary words, which has all the letters from the string licensePlate. Such a word is said to complete th 阅读全文
posted @ 2018-02-02 23:29 Grandyang 阅读(3525) 评论(0) 推荐(0) 编辑
摘要: You have 4 cards each containing a number from 1 to 9. You need to judge whether they could operated through *, /, +, -, (, )to get the value of 24. E 阅读全文
posted @ 2018-01-31 21:59 Grandyang 阅读(14265) 评论(12) 推荐(3) 编辑
摘要: In a given integer array nums, there is always exactly one largest element. Find whether the largest element in the array is at least twice as much as 阅读全文
posted @ 2018-01-30 22:06 Grandyang 阅读(3365) 评论(0) 推荐(0) 编辑
摘要: You are asked to cut off trees in a forest for a golf event. The forest is represented as a non-negative 2D map, in this map: 0 represents the obstacl 阅读全文
posted @ 2018-01-29 21:13 Grandyang 阅读(5300) 评论(1) 推荐(0) 编辑
摘要: Nearly everyone has used the Multiplication Table. The multiplication table of size m x n is an integer matrix mat where mat[i][j] == i * j (1-indexed 阅读全文
posted @ 2018-01-27 22:38 Grandyang 阅读(5000) 评论(7) 推荐(0) 编辑
摘要: On a staircase, the i-th step has some non-negative cost cost[i] assigned (0 indexed). Once you pay the cost, you can either climb one or two steps. Y 阅读全文
posted @ 2018-01-24 22:27 Grandyang 阅读(10047) 评论(4) 推荐(1) 编辑
摘要: Given many words, words[i] has weight i. Design a class WordFilter that supports one function, WordFilter.f(String prefix, String suffix). It will ret 阅读全文
posted @ 2018-01-22 23:18 Grandyang 阅读(5313) 评论(1) 推荐(0) 编辑
摘要: There is a strange printer with the following two special requirements: The printer can only print a sequence of the same character each time. At each 阅读全文
posted @ 2018-01-20 09:44 Grandyang 阅读(5753) 评论(0) 推荐(0) 编辑
摘要: 使用Ubuntu的虚拟机时如果不能主机之间进行复制粘粘,会非常非常的不方便,所以我们需要安装vmware tools,使用如下的代码(注意第二句一定要有,不然还是不能复制粘贴): 阅读全文
posted @ 2018-01-18 11:10 Grandyang 阅读(1319) 评论(0) 推荐(0) 编辑
摘要: 在使用微信官方给的添加自定义菜单的示例代码: 可能会遇到如下的错误: 原因出在小程序的链接上,官方只是给了个例子教你如何添加小程序链接到菜单栏,但是这个小程序并不是归属于你的,所以错误提示说appid没有绑定,这里的appid是小程序的,当然没有和你的绑定,所以只要将这段整个删掉就好了: 阅读全文
posted @ 2018-01-15 02:05 Grandyang 阅读(4196) 评论(0) 推荐(0) 编辑
摘要: Given a list of sorted characters letters containing only lowercase letters, and given a target letter target, find the smallest element in the list t 阅读全文
posted @ 2018-01-14 23:58 Grandyang 阅读(4006) 评论(0) 推荐(0) 编辑
摘要: There are N network nodes, labelled 1 to N. Given times, a list of travel times as directededges times[i] = (u, v, w), where u is the source node, v i 阅读全文
posted @ 2018-01-12 23:52 Grandyang 阅读(11483) 评论(8) 推荐(0) 编辑
摘要: Start from integer 1, remove any integer that contains 9 such as 9, 19, 29... So now, you will have a new integer sequence: 1, 2, 3, 4, 5, 6, 7, 8, 10 阅读全文
posted @ 2018-01-10 23:13 Grandyang 阅读(3203) 评论(14) 推荐(0) 编辑
摘要: Given a binary tree where every node has a unique value, and a target key k, find the value of the nearest leaf node to target k in the tree. Here, ne 阅读全文
posted @ 2018-01-08 23:46 Grandyang 阅读(6185) 评论(3) 推荐(0) 编辑
摘要: In a N x N grid representing a field of cherries, each cell is one of three possible integers. 0 means the cell is empty, so you can pass through; 1 m 阅读全文
posted @ 2018-01-06 23:58 Grandyang 阅读(10454) 评论(1) 推荐(0) 编辑
摘要: 在配置WebDriverAgent的时候,可能会遇到如下的错误: 2018-01-04 09:53:42.759370-0600 WebDriverAgentRunner-Runner[318:13300] +[CATransaction synchronize] called within tra 阅读全文
posted @ 2018-01-05 10:53 Grandyang 阅读(2358) 评论(0) 推荐(0) 编辑
摘要: Given an array A (index starts at 1) consisting of N integers: A1, A2, ..., AN and an integer B. The integer Bdenotes that from any place (suppose the 阅读全文
posted @ 2018-01-03 14:03 Grandyang 阅读(5476) 评论(1) 推荐(0) 编辑
摘要: Given an array nums of integers, you can perform operations on the array. In each operation, you pick any nums[i] and delete it to earn nums[i] points 阅读全文
posted @ 2018-01-02 14:00 Grandyang 阅读(6956) 评论(0) 推荐(0) 编辑
摘要: Given a list of daily temperatures, produce a list that, for each day in the input, tells you how many days you would have to wait until a warmer temp 阅读全文
posted @ 2017-12-24 10:37 Grandyang 阅读(10945) 评论(5) 推荐(0) 编辑
摘要: Given a non-negative integer N, find the largest number that is less than or equal to N with monotone increasing digits. (Recall that an integer has m 阅读全文
posted @ 2017-12-19 23:43 Grandyang 阅读(4925) 评论(2) 推荐(0) 编辑
摘要: Given two sentences words1, words2 (each represented as an array of strings), and a list of similar word pairs pairs, determine if two sentences are s 阅读全文
posted @ 2017-12-17 23:49 Grandyang 阅读(6759) 评论(0) 推荐(0) 编辑
摘要: You are given a string expression representing a Lisp-like expression to return the integer value of. The syntax for these expressions is given as fol 阅读全文
posted @ 2017-12-15 23:48 Grandyang 阅读(4831) 评论(1) 推荐(0) 编辑
摘要: We are given an array asteroids of integers representing asteroids in a row. For each asteroid, the absolute value represents its size, and the sign r 阅读全文
posted @ 2017-12-13 23:41 Grandyang 阅读(5503) 评论(0) 推荐(1) 编辑
摘要: Given an array consisting of n integers, find the contiguous subarray whose length is greater than or equal to k that has the maximum average value. A 阅读全文
posted @ 2017-12-11 06:41 Grandyang 阅读(12183) 评论(0) 推荐(1) 编辑
摘要: Given two sentences words1, words2 (each represented as an array of strings), and a list of similar word pairs pairs, determine if two sentences are s 阅读全文
posted @ 2017-12-10 09:42 Grandyang 阅读(6538) 评论(0) 推荐(0) 编辑
摘要: Implement a MyCalendarThree class to store your events. A new event can always be added. Your class will have one method, book(int start, int end). Fo 阅读全文
posted @ 2017-12-08 13:53 Grandyang 阅读(5019) 评论(1) 推荐(1) 编辑
摘要: 在使用python爬虫提取中文网页的内容,为了能正确显示中文的内容,在转为字符串时一定要声明编码为utf-8,否则无法正常显示中文,而是显示原编码的字符,并没有正确转换。比如下面这个简单的爬取百度页面的title的示例: 如果不在tostring函数中正确配置的话,会打印出: 而正确的应该是: 阅读全文
posted @ 2017-12-06 01:36 Grandyang 阅读(5710) 评论(0) 推荐(1) 编辑
上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 44 下一页
Fork me on GitHub