摘要: given an integer,write a function to determine if it is a power of three.class Solution {public: bool isPowerOfThree(int n) { if(n<1) return... 阅读全文
posted @ 2016-01-08 18:41 尾巴草 阅读(134) 评论(0) 推荐(0) 编辑
摘要: Problem:Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements.For examp... 阅读全文
posted @ 2016-01-08 17:03 尾巴草 阅读(131) 评论(0) 推荐(0) 编辑
摘要: Problem:There are n bulbs that are initially off. You first turn on all the bulbs. Then, you turn off every second bulb. On the third round, you toggl... 阅读全文
posted @ 2016-01-08 16:46 尾巴草 阅读(114) 评论(0) 推荐(0) 编辑