摘要: Give a string s, count the number of non-empty (contiguous) substrings that have the same number of 0's and 1's, and all the 0's and all the 1's in these substrings are grouped consecutively.Substring... 阅读全文
posted @ 2017-10-17 23:02 xiejunzhao 阅读(1134) 评论(0) 推荐(0)
摘要: Given a string, sort it in decreasing order based on the frequency of characters.Example 1:Input: "tree" Output: "eert" Explanation: 'e' appears twice while 'r' and 't' both appear once. So 'e' must... 阅读全文
posted @ 2017-10-17 00:25 xiejunzhao 阅读(192) 评论(0) 推荐(0)