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 阅读(255) 评论(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 阅读(147) 评论(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 阅读(558) 评论(0) 推荐(0) 编辑

导航