- 博客(19)
- 收藏
- 关注
原创 第十八周leetcode题
Description:Given an array of numbers nums, in which exactly two elements appear only once and all the other elements appear exactly twice. Find the two elements that appear only once.For
2017-07-15 00:17:11 238 1
原创 8.19风筝图
Description:所谓风筝图是这样的,其定点数为偶数,比如2n,且其中的n个顶点构成一个团,其余的n个顶点则由一条称为“尾巴”的路径连接,尾巴的某个与团中一个顶点相连。给定一个图和目标g,风筝图问题要求该图的一个包含2g个顶点的风筝子图。请证明该问题是NP-完全的。将团问题规约到风筝图问题。设原图为G(V,E),求G的最大团,将|V|个顶点加入到G中,这些顶点
2017-07-14 11:38:19 789
原创 第十七周leetcode题
Description:You are playing the following Bulls and Cows game with your friend: You write down a number and ask your friend to guess what the number is. Each time your friend makes a guess, yo
2017-07-13 12:24:36 272
原创 第十六周leetcode
Description:Note: This is an extension of House Robber.After robbing those houses on that street, the thief has found himself a new place for his thievery so that he will not get too much at
2017-06-11 23:19:52 1242
原创 第十五周leetcode题
Description:You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is t
2017-05-31 15:52:10 226
原创 第十四周leetcode题
Description:A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below).The robot can only move either down or right at any point in time. The robot is tr
2017-05-30 18:33:32 199
原创 第十三周leetcode题
Description:Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array [-2,1,-3,4,-1,2,1,-5,4],the contiguous suba
2017-05-29 01:42:39 220
原创 第十二周leetcode题
Description:Related to question Excel Sheet Column TitleGiven a column title as appear in an Excel sheet, return its corresponding column number.For example: A -> 1 B -> 2 C
2017-05-21 22:31:49 190
原创 第十一周leeetcode题
Description:iven two strings s and t which consist of only lowercase letters.String t is generated by random shuffling string s and then add one more letter at a random position.Find the
2017-05-14 23:18:31 640
原创 第十周leetcode题
Description: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", "Silver Medal" and "Bronze Medal".
2017-05-05 19:13:34 171
原创 第九周leetcode题
description:Given an arbitrary ransom note string and another string containing letters from all the magazines, write a function that will return true if the ransom note can be constructed from
2017-04-26 19:21:47 284
原创 第八周leetcode题
Description:Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.The brackets must close in the correct order, "()" and "()
2017-04-17 22:12:51 194
原创 第七周leetcode题
Description:ou have a total of n coins that you want to form in a staircase shape, where every k-th row must have exactly k coins.Given n, find the total number of full staircase rows that c
2017-04-16 19:41:58 348
原创 第六周leetcode题
description:Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.将两个已经排好序的数组合并为一个,因为两个数列已经排好序,所以只需要分别顺序检
2017-04-06 20:26:49 296
原创 第五周leetcode题
description:You are climbing a stair case. It takes n steps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?Note: Give
2017-03-28 12:05:29 509
原创 第四周leetcode题
Description:Say you have an array for which the ith element is the price of a given stock on day i.If you were only permitted to complete at most one transaction (ie, buy one and sell one sh
2017-03-20 23:22:28 237
原创 第三周leetcode题
description:Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array.For example,Given nums = [0, 1, 3] return 2.Note:Yo
2017-03-14 14:25:02 240
原创 第二周leetcode水题
description:Write a program to check whether a given number is an ugly number.Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For example, 6, 8 are ugly while 1
2017-03-07 13:36:45 363
原创 第一次leetcode题目
鉴于刚放完寒假,状态不是特别好,再加上第一次接触leetcode,所以第一周就挑一条简单的题先找找感觉。description:Write an algorithm to determine if a number is "happy".A happy number is a number defined by the following process: Star
2017-02-26 22:37:29 244
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人