leetcode之javascript
superpig101
一只特立独行的猪
展开
-
Reverse Bits
题目如下: Reverse bits of a given 32 bits unsigned integer. For example, given input 43261596 (represented in binary as 00000010100101000001111010011100), return 964176192 (represented in binary as0原创 2015-03-25 15:40:53 · 486 阅读 · 0 评论 -
Rotate Array
题目如下: Rotate an array of n elements to the right by k steps. For example, with n = 7 and k = 3, the array [1,2,3,4,5,6,7] is rotated to [5,6,7,1,2,3,4]. 第一种方法: var rotate = function(nums原创 2015-03-25 17:04:42 · 619 阅读 · 0 评论