- 博客(10)
- 收藏
- 关注
原创 Samall String
Description: Dr lee cuts a string S into N pieces,s[1],…,s[N]. Now, Dr lee gives you these N sub-strings: s[1],…s[N]. There might be several possibilities that the string S could be. For example, if
2017-10-19 23:59:26 538
原创 期末作业8.14
8.14 Prove that the following problem is NP-complete: given an undirected gragh G={V,E} and an integer k,return a clique of size k as well as an independent set of size k,provided both exist.prove:可以
2017-07-10 16:40:36 312
原创 1002.等价二叉树
两个二叉树结构相同,且对应结点的值相同,我们称这两个二叉树等价.例如:以下两个二叉树等价 1 1 / \ / \ 2 3 2 3 而以下两个则不等价 1 1 / \ / \ 2 3 3
2017-06-25 21:24:44 318
原创 1001.会议安排
N个会议要同时举行,参会人数分别为A[0], A[1], …, A[N-1]. 现有M个会议室,会议室可容纳人数分别为B[0], B[1], …, B[M-1]. 当A[i]<=B[j]时,可以把会议i安排在会议室j,每间会议室最多安排一个会议,每个会议最多只能安排一个会议室. 求最多安排多少个会议.1 <= N, M <= 100000, 每个会议的参会人数和每间会议室的容纳人数均在1和1000之
2017-06-25 18:40:11 552
原创 412. Fizz Buzz Add to List
Write a program that outputs the string representation of numbers from 1 to n. But for multiples of three it should output “Fizz” instead of the number and for the multiples of five output “Buzz”. For
2017-04-18 14:12:57 280
原创 500. Keyboard Row
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. Example 1: Input: [“Hello”, “Alaska”, “Dad”, “Peace
2017-03-27 21:59:39 231
原创 476. Number Complement Add to List
Given a positive integer, output its complement number. The complement strategy is to flip the bits of its binary representation. Note: The given integer is guaranteed to fit within the range of a 32
2017-03-20 01:46:24 370
原创 461.Hamming Distance Add to List
The Hamming distance between two integers is the number of positions at which the corresponding bits are different. Given two integers x and y, calculate the Hamming distance. Note: 0 ≤ x, y < 231.
2017-03-13 14:14:25 273
原创 448.Find All Numbers Disappeared in an Array
Given an array of integers where 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once. Find all the elements of [1, n] inclusive that do not appear in this array. Could
2017-03-06 21:45:22 196
原创 104.Maximum Depth of Binary Tree Add to List
Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.Subscribe to see which companies asked th
2017-02-25 15:25:16 347
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人