上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 27 下一页
摘要: Given an array of integers, 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once.Find all the elements that appear twice in this array.Could you do it without extra spac... 阅读全文
posted @ 2017-03-11 12:40 xiejunzhao 阅读(128) 评论(0) 推荐(0)
摘要: We are playing the Guess Game. The game is as follows:I pick a number from 1 to n. You have to guess which number I picked.Every time you guess wrong, I'll tell you whether the number is higher or low... 阅读全文
posted @ 2017-03-09 23:53 xiejunzhao 阅读(203) 评论(0) 推荐(0)
摘要: Node.JS 文件读写,把Sheet图集数据转换为龙骨动画图集数据var fs = require("fs")var readline = require("readline");var rl = readline.createInterface({ input:process.stdin, output:process.stdout});var path = undefined;... 阅读全文
posted @ 2017-03-08 22:05 xiejunzhao 阅读(381) 评论(0) 推荐(0)
摘要: class Program { static double size = 2.443438914027149; static void Main(string[] args) { if (!System.IO.Directory.Exists("Img")){ System.IO.Directory... 阅读全文
posted @ 2017-03-07 22:15 xiejunzhao 阅读(289) 评论(0) 推荐(0)
摘要: Determine whether an integer is a palindrome. Do this without extra space.题意:判断一个数字是否为回文数如何取得一个Integer的最高位?假设x = 688答:x / mask. 设置一个和x位数一样的mask,mask = 100,然后用x/mask,表示x里面有几个mask,即是最高位数字. 688里有6个100,即为... 阅读全文
posted @ 2017-03-06 22:19 xiejunzhao 阅读(187) 评论(0) 推荐(0)
摘要: Given an integer n, return the number of trailing zeroes in n!.Note: Your solution should be in logarithmic time complexity.http://bookshadow.com/weblog/2014/12/30/leetcode-factorial-trailing-zeroes/题... 阅读全文
posted @ 2017-03-03 22:37 xiejunzhao 阅读(240) 评论(0) 推荐(0)
摘要: Implement the following operations of a queue using stacks.push(x) -- Push element x to the back of queue.pop() -- Removes the element from in front of queue.peek() -- Get the front element.empty() --... 阅读全文
posted @ 2017-03-02 22:54 xiejunzhao 阅读(158) 评论(0) 推荐(0)
摘要: Implement the following operations of a stack using queues.push(x) -- Push element x onto stack.pop() -- Removes the element on top of the stack.top() -- Get the top element.empty() -- Return whether ... 阅读全文
posted @ 2017-03-02 22:53 xiejunzhao 阅读(270) 评论(0) 推荐(0)
摘要: Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.Do not allocate extra space for another array, you must do this in place with con... 阅读全文
posted @ 2017-03-01 23:41 xiejunzhao 阅读(129) 评论(0) 推荐(0)
摘要: Given an index k, return the kth row of the Pascal's triangle.For example, given k = 3,Return [1,3,3,1].Note:Could you optimize your algorithm to use only O(k) extra space?题意:计算杨辉三角的某一行,要求空间复杂度为O(k)pu... 阅读全文
posted @ 2017-03-01 23:40 xiejunzhao 阅读(83) 评论(0) 推荐(0)
上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 27 下一页