上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 21 下一页

2016年6月29日

Backpack

摘要: Given n items with size Ai, an integer m denotes the size of a backpack. How full you can fill this backpack? If we have 4 items with size [2, 3, 5, 7 阅读全文

posted @ 2016-06-29 11:51 Sheryl Wang 阅读(220) 评论(0) 推荐(0) 编辑

K Sum

摘要: Given n distinct positive integers, integer k (k <= n) and a number target. Find k numbers where sum is target. Calculate how many solutions there are 阅读全文

posted @ 2016-06-29 11:37 Sheryl Wang 阅读(369) 评论(0) 推荐(0) 编辑

2016年6月27日

Backpack II 0-1背包

摘要: Given n items with size Ai and value Vi, and a backpack with size m. What's the maximum value can you put into the backpack? Given 4 items with size [ 阅读全文

posted @ 2016-06-27 22:17 Sheryl Wang 阅读(253) 评论(0) 推荐(0) 编辑

Group Anagrams

摘要: Given an array of strings, group anagrams together. For example, given: ["eat", "tea", "tan", "ate", "nat", "bat"], Return: 这题其实是算是Valid Anagram的一个fol 阅读全文

posted @ 2016-06-27 21:23 Sheryl Wang 阅读(146) 评论(0) 推荐(0) 编辑

Valid Anagram

摘要: Given two strings s and t, write a function to determine if t is an anagram of s. For example,s = "anagram", t = "nagaram", return true.s = "rat", t = 阅读全文

posted @ 2016-06-27 21:10 Sheryl Wang 阅读(210) 评论(0) 推荐(0) 编辑

Sums of Sums

摘要: Alice presented her friend Bob with an array of N positive integers, indexed from 1 to N. She challenged Bob with many queries of the form "what is th 阅读全文

posted @ 2016-06-27 17:23 Sheryl Wang 阅读(557) 评论(0) 推荐(0) 编辑

2016年6月25日

Longest Increasing Continuous subsequence II

摘要: Give you an integer matrix (with row size n, column size m),find the longest increasing continuous subsequence in this matrix. (The definition of the 阅读全文

posted @ 2016-06-25 20:21 Sheryl Wang 阅读(149) 评论(0) 推荐(0) 编辑

Scramble String

摘要: Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively. Below is one possible representati 阅读全文

posted @ 2016-06-25 16:25 Sheryl Wang 阅读(192) 评论(0) 推荐(0) 编辑

Burst Balloons

摘要: Given n balloons, indexed from 0 to n-1. Each balloon is painted with a number on it represented by array nums. You are asked to burst all the balloon 阅读全文

posted @ 2016-06-25 11:17 Sheryl Wang 阅读(286) 评论(0) 推荐(1) 编辑

2016年6月24日

Coins in a Line III

摘要: There are n coins in a line. Two players take turns to take a coin from one of the ends of the line until there are no more coins left. The player wit 阅读全文

posted @ 2016-06-24 11:01 Sheryl Wang 阅读(307) 评论(0) 推荐(0) 编辑

上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 21 下一页

导航