摘要: You are given two jugs with capacities x and y litres. There is an infinite amount of water supply available. You need to determine whether it is poss 阅读全文
posted @ 2016-11-28 12:34 微微程序媛 阅读(391) 评论(0) 推荐(0) 编辑
摘要: Given a collection of intervals, find the minimum number of intervals you need to remove to make the rest of the intervals non-overlapping. Note: Exam 阅读全文
posted @ 2016-11-28 12:05 微微程序媛 阅读(359) 评论(0) 推荐(0) 编辑
摘要: There are a number of spherical balloons spread in two-dimensional space. For each balloon, provided input is the start and end coordinates of the hor 阅读全文
posted @ 2016-11-28 11:51 微微程序媛 阅读(218) 评论(0) 推荐(0) 编辑
摘要: A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null. Return a deep copy 阅读全文
posted @ 2016-11-28 11:13 微微程序媛 阅读(118) 评论(0) 推荐(0) 编辑
摘要: Given two numbers represented as strings, return multiplication of the numbers as a string. Note: The numbers can be arbitrarily large and are non-neg 阅读全文
posted @ 2016-11-28 08:21 微微程序媛 阅读(125) 评论(0) 推荐(0) 编辑
摘要: Given an integer, write an algorithm to convert it to hexadecimal. For negative integer, two’s complementmethod is used. Note: Example 1: Example 2: 阅读全文
posted @ 2016-11-28 07:41 微微程序媛 阅读(203) 评论(0) 推荐(0) 编辑
摘要: Given an unsorted array of integers, find the length of longest increasing subsequence. For example,Given [10, 9, 2, 5, 3, 7, 101, 18],The longest inc 阅读全文
posted @ 2016-11-28 07:23 微微程序媛 阅读(110) 评论(0) 推荐(0) 编辑
摘要: Given an 2D board, count how many different battleships are in it. The battleships are represented with 'X's, empty slots are represented with '.'s. Y 阅读全文
posted @ 2016-11-28 06:19 微微程序媛 阅读(211) 评论(0) 推荐(0) 编辑
摘要: You are given two linked lists representing two non-negative numbers. The most significant digit comes first and each of their nodes contain a single 阅读全文
posted @ 2016-11-28 05:56 微微程序媛 阅读(263) 评论(0) 推荐(0) 编辑
摘要: 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 tha 阅读全文
posted @ 2016-11-28 01:28 微微程序媛 阅读(167) 评论(0) 推荐(0) 编辑
摘要: 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 yo 阅读全文
posted @ 2016-11-28 01:01 微微程序媛 阅读(129) 评论(0) 推荐(0) 编辑
摘要: There is a fence with n posts, each post can be painted with one of the k colors. You have to paint all the posts such that no more than two adjacent 阅读全文
posted @ 2016-11-28 00:49 微微程序媛 阅读(369) 评论(0) 推荐(0) 编辑
摘要: Given two integers n and k, return all possible combinations of k numbers out of 1 ... n. For example,If n = 4 and k = 2, a solution is: 阅读全文
posted @ 2016-11-28 00:38 微微程序媛 阅读(158) 评论(0) 推荐(0) 编辑