摘要: Validate if a given string is numeric. Some examples:"0" => true" 0.1 " => true"abc" => false"1 a" => false"2e10" => true Note: It is intended for the 阅读全文
posted @ 2017-12-01 14:21 jasminemzy 阅读(203) 评论(0) 推荐(0) 编辑
摘要: Design a data structure that supports all following operations in average O(1) time. Note: Duplicate elements are allowed. Example: 算法:试了一下用双Map无法实现频率 阅读全文
posted @ 2017-12-01 13:08 jasminemzy 阅读(142) 评论(0) 推荐(0) 编辑
摘要: Design a data structure that supports all following operations in average O(1) time. Example: 性能这么好肯定是得空间换时间。加删都是O(1),想到要用到Hash,但是HashSet不能random存取,所以 阅读全文
posted @ 2017-12-01 09:57 jasminemzy 阅读(156) 评论(0) 推荐(0) 编辑
摘要: Given an array of words and a length L, format the text such that each line has exactly L characters and is fully (left and right) justified. You shou 阅读全文
posted @ 2017-12-01 07:06 jasminemzy 阅读(169) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers nums and a positive integer k, find whether it's possible to divide this array into k non-empty subsets whose sums are all 阅读全文
posted @ 2017-12-01 04:37 jasminemzy 阅读(596) 评论(0) 推荐(0) 编辑