摘要: 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 @ 2015-10-07 12:01 Hygeia 阅读(146) 评论(0) 推荐(0) 编辑
摘要: Given an array containingndistinct numbers taken from0, 1, 2, ..., n, find the one that is missing from the array.For example,Givennums=[0, 1, 3]retur... 阅读全文
posted @ 2015-10-07 11:18 Hygeia 阅读(117) 评论(0) 推荐(0) 编辑
摘要: Given an arraynums, write a function to move all0's to the end of it while maintaining the relative order of the non-zero elements.For example, givenn... 阅读全文
posted @ 2015-10-07 10:58 Hygeia 阅读(127) 评论(0) 推荐(0) 编辑
摘要: Given apatternand a stringstr, find ifstrfollows the same pattern.Examples:pattern ="abba", str ="dog cat cat dog"should return true.pattern ="abba", ... 阅读全文
posted @ 2015-10-07 10:30 Hygeia 阅读(204) 评论(0) 推荐(0) 编辑