上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 27 下一页
摘要: Given an array of characters, compress it in-place.The length after compression must always be smaller than or equal to the original array.Every element of the array should be a character (not int) of... 阅读全文
posted @ 2017-11-04 18:18 xiejunzhao 阅读(1072) 评论(0) 推荐(0)
摘要: We have two special characters. The first character can be represented by one bit 0. The second character can be represented by two bits (10 or 11).Now given a string represented by several bits. Retu... 阅读全文
posted @ 2017-11-04 18:18 xiejunzhao 阅读(312) 评论(0) 推荐(0)
摘要: 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)
摘要: Given a non-empty array of non-negative integers nums, the degree of this array is defined as the maximum frequency of any one of its elements.Your task is to find the smallest possible length of a (c... 阅读全文
posted @ 2017-10-15 21:55 xiejunzhao 阅读(182) 评论(0) 推荐(0)
摘要: let co = require("co");//模拟异步操作let wait = (t) => { return new Promise((resolve, reject) => { console.log("start:" + t); setTimeout(() => { console.log(t); resolv... 阅读全文
posted @ 2017-10-14 22:55 xiejunzhao 阅读(1378) 评论(0) 推荐(0)
摘要: Given a non-empty integer array, find the minimum number of moves required to make all array elements equal, where a move is incrementing a selected element by 1 or decrementing a selected element by ... 阅读全文
posted @ 2017-10-13 22:30 xiejunzhao 阅读(144) 评论(0) 推荐(0)
摘要: Given a list of directory info including directory path, and all the files with contents in this directory, you need to find out all the groups of duplicate files in the file system in terms of their ... 阅读全文
posted @ 2017-10-11 20:25 xiejunzhao 阅读(347) 评论(0) 推荐(0)
摘要: Given the root of a tree, you are asked to find the most frequent subtree sum. The subtree sum of a node is defined as the sum of all the node values formed by the subtree rooted at that node (includi... 阅读全文
posted @ 2017-10-11 20:25 xiejunzhao 阅读(292) 评论(0) 推荐(0)
摘要: Given an array of numbers nums, in which exactly two elements appear only once and all the other elements appear exactly twice. Find the two elements that appear only once.For example:Given nums = [1,... 阅读全文
posted @ 2017-10-11 20:22 xiejunzhao 阅读(115) 评论(0) 推荐(0)
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 27 下一页