摘要:
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
阅读(5039)
推荐(1)
摘要:
在使用python爬虫提取中文网页的内容,为了能正确显示中文的内容,在转为字符串时一定要声明编码为utf-8,否则无法正常显示中文,而是显示原编码的字符,并没有正确转换。比如下面这个简单的爬取百度页面的title的示例: 如果不在tostring函数中正确配置的话,会打印出: 而正确的应该是:
阅读全文
posted @ 2017-12-06 01:36
Grandyang
阅读(5733)
推荐(1)
摘要:
An image is represented by a 2-D array of integers, each integer representing the pixel value of the image (from 0 to 65535). Given a coordinate (sr,
阅读全文
posted @ 2017-12-05 23:23
Grandyang
阅读(11112)
推荐(0)
摘要:
Implement a MyCalendarTwo class to store your events. A new event can be added if adding the event will not cause a triple booking. Your class will ha
阅读全文
posted @ 2017-12-03 23:50
Grandyang
阅读(8423)
推荐(1)
摘要:
Given a string S, find the number of different non-empty palindromic subsequences in S, and return that number modulo 10^9 + 7. A subsequence of a str
阅读全文
posted @ 2017-12-01 14:13
Grandyang
阅读(7516)
推荐(0)
摘要:
Implement a MyCalendar class to store your events. A new event can be added if adding the event will not cause a double booking. Your class will have
阅读全文
posted @ 2017-11-29 14:14
Grandyang
阅读(7389)
推荐(1)
摘要:
A self-dividing number is a number that is divisible by every digit it contains. For example, 128 is a self-dividing number because 128 % 1 == 0, 128
阅读全文
posted @ 2017-11-27 23:55
Grandyang
阅读(4445)
推荐(0)
摘要:
Design a search autocomplete system for a search engine. Users may input a sentence (at least one word and end with a special character '#'). For each
阅读全文
posted @ 2017-11-25 23:56
Grandyang
阅读(12381)
推荐(0)
摘要:
Given a (singly) linked list with head node root, write a function to split the linked list into k consecutive linked list "parts". The length of each
阅读全文
posted @ 2017-11-22 12:04
Grandyang
阅读(5060)
推荐(1)
摘要:
下面是iOS开发用第三方库可能出现的错误,及其解决方法: 1. 'NSInvalidArgumentException', reason: '-[UITableView mas_makeConstraints:]: unrecognized selector sent to instance 0x7
阅读全文
posted @ 2017-11-21 13:08
Grandyang
阅读(5293)
推荐(0)
摘要:
Given an array of integers nums, write a method that returns the "pivot" index of this array. We define the pivot index as the index where the sum of
阅读全文
posted @ 2017-11-20 12:08
Grandyang
阅读(5528)
推荐(0)
摘要:
This question is about implementing a basic elimination algorithm for Candy Crush. Given a 2D integer array board representing the grid of candy, diff
阅读全文
posted @ 2017-11-18 23:40
Grandyang
阅读(12047)
推荐(1)
摘要:
Given a C++ program, remove comments from it. The program source is an array where source[i] is the i-th line of the source code. This represents the
阅读全文
posted @ 2017-11-15 23:58
Grandyang
阅读(6034)
推荐(0)
摘要:
Given a list accounts, each element accounts[i] is a list of strings, where the first element accounts[i][0] is a name, and the rest of the elements a
阅读全文
posted @ 2017-11-13 23:52
Grandyang
阅读(14777)
推荐(0)
摘要:
Design a max stack that supports push, pop, top, peekMax and popMax. push(x) -- Push element x onto stack. pop() -- Remove the element on top of the s
阅读全文
posted @ 2017-11-12 22:56
Grandyang
阅读(16140)
推荐(0)
摘要:
Given a list of strings words representing an English Dictionary, find the longest word in words that can be built one character at a time by other wo
阅读全文
posted @ 2017-11-10 23:52
Grandyang
阅读(7164)
推荐(0)
摘要:
Given two integer arrays A and B, return the maximum length of an subarray that appears in both arrays. Example 1: Input: A: [1,2,3,2,1] B: [3,2,1,4,7
阅读全文
posted @ 2017-11-07 22:37
Grandyang
阅读(10323)
推荐(0)
摘要:
We have two special characters. The first character can be represented by one bit 0. The second character can be represented by two bits (10 or 11). N
阅读全文
posted @ 2017-11-05 23:57
Grandyang
阅读(5648)
推荐(0)
摘要:
在使用Visual Studio进行项目开发的时候,有时候会遇到下面这个错误: Unhandled exception at 0x00905a4d in xxx.exe: 0xC0000005: Access violation 产生这个错误的原因可能是在Visual Studio中链接了后缀为"*
阅读全文
posted @ 2017-11-04 00:54
Grandyang
阅读(1478)
推荐(0)
摘要:
Your are given an array of integers prices, for which the i-th element is the price of a given stock on day i; and a non-negative integer fee represen
阅读全文
posted @ 2017-11-03 10:29
Grandyang
阅读(9674)
推荐(1)
摘要:
在用VS开发项目的时候,我们可以将不同的模块拆分开来,分别建立单独的Project来开发调试,整个放到一个Solution中就行了。这样做的好处是结构清晰,每个功能模块可以单独调试,而不用编译整个Solution,尤其当项目很大的时候,能节省很多编译时间。而且各个项目之间相互独立,对于每个模块,我们
阅读全文
posted @ 2017-11-01 11:32
Grandyang
阅读(865)
推荐(0)
摘要:
Your are given an array of positive integers nums. Count and print the number of (contiguous) subarrays where the product of all the elements in the s
阅读全文
posted @ 2017-10-30 12:32
Grandyang
阅读(8675)
推荐(1)
摘要:
Given two strings s1, s2, find the lowest ASCII sum of deleted characters to make two strings equal. Example 1: Input: s1 = "sea", s2 = "eat" Output:
阅读全文
posted @ 2017-10-29 23:50
Grandyang
阅读(5714)
推荐(1)
摘要:
There are some trees, where each tree is represented by (x,y) coordinate in a two-dimensional garden. Your job is to fence the entire garden using the
阅读全文
posted @ 2017-10-27 23:54
Grandyang
阅读(4589)
推荐(0)
摘要:
3D Slicer Reconstruct CT/MRI 1. Load DCM file of your CT/MRI 2. Go to Volume Rendering, click the eye button to show volume 3. Go to Editor -> Thresho
阅读全文
posted @ 2017-10-26 23:58
Grandyang
阅读(1064)
推荐(0)
摘要:
Given an integer array nums and an integer k, return true if it is possible to divide this array into k non-empty subsets whose sums are all equal. Ex
阅读全文
posted @ 2017-10-25 23:38
Grandyang
阅读(17636)
推荐(1)
摘要:
Given a non-empty array of non-negative integers nums, the degree of this array is defined as the maximum frequency of any one of its elements. Your t
阅读全文
posted @ 2017-10-24 12:39
Grandyang
阅读(8618)
推荐(1)
摘要:
Give a string s, count the number of non-empty (contiguous) substrings that have the same number of 0's and 1's, and all the 0's and all the 1's in th
阅读全文
posted @ 2017-10-23 12:25
Grandyang
阅读(6277)
推荐(0)
摘要:
Given a non-empty 2D array grid of 0's and 1's, an island is a group of 1's (representing land) connected 4-directionally (horizontal or vertical.) Yo
阅读全文
posted @ 2017-10-22 23:51
Grandyang
阅读(9880)
推荐(0)
摘要:
Given a non-empty 2D array grid of 0's and 1's, an island is a group of 1's (representing land) connected 4-directionally (horizontal or vertical.) Yo
阅读全文
posted @ 2017-10-20 11:53
Grandyang
阅读(17404)
推荐(0)
摘要:
Given a positive integer, check whether it has alternating bits: namely, if two adjacent bits will always have different values. Example 1: Input: 5 O
阅读全文
posted @ 2017-10-19 23:51
Grandyang
阅读(4028)
推荐(1)
摘要:
Given a non-empty list of words, return the k most frequent elements. Your answer should be sorted by frequency from highest to lowest. If two words h
阅读全文
posted @ 2017-10-18 23:52
Grandyang
阅读(12853)
推荐(0)
摘要:
Error: nafxcw.lib(afxmem.obj) : error LNK2005: "void * __cdecl operator new[](unsigned int)" (??_U@YAPAXI@Z) already defined in libcpmt.lib(newaop.obj
阅读全文
posted @ 2017-10-17 06:48
Grandyang
阅读(1645)
推荐(1)
摘要:
Given a sorted array consisting of only integers where every element appears twice except for one element which appears once. Find this single element
阅读全文
posted @ 2017-10-16 21:42
Grandyang
阅读(6109)
推荐(0)
摘要:
How would you design a URL shortening service that is similar to TinyURL? Background:TinyURL is a URL shortening service where you enter a URL such as
阅读全文
posted @ 2017-10-15 23:51
Grandyang
阅读(6189)
推荐(0)
摘要:
You are given coins of different denominations and a total amount of money. Write a function to compute the number of combinations that make up that a
阅读全文
posted @ 2017-10-14 23:47
Grandyang
阅读(16320)
推荐(1)
摘要:
There are 1000 buckets, one and only one of them contains poison, the rest are filled with water. They all look the same. If a pig drinks that poison
阅读全文
posted @ 2017-10-13 23:45
Grandyang
阅读(6890)
推荐(0)
摘要:
You are given a circular array nums of positive and negative integers. If a number k at an index is positive, then move forward k steps. Conversely, i
阅读全文
posted @ 2017-10-12 21:09
Grandyang
阅读(10388)
推荐(0)
摘要:
A gene string can be represented by an 8-character long string, with choices from "A", "C", "G", "T". Suppose we need to investigate about a mutation
阅读全文
posted @ 2017-10-11 21:40
Grandyang
阅读(4658)
推荐(0)
摘要:
Given an integer n, return the largest palindromic integer that can be represented as the product of two n-digits integers. Since the answer can be ve
阅读全文
posted @ 2017-10-10 11:32
Grandyang
阅读(4877)
推荐(0)