摘要: Problem: Given an integer, write a function to determine if it is a power of two. Summary: 判断一个数n是不是2的整数幂。 Analysis: 这道题首先需要注意n为非整数是返回false的情况。 1. 若将n 阅读全文
posted @ 2016-11-01 12:04 SillyVicky 阅读(184) 评论(0) 推荐(0)
摘要: Problem: You have a total of n coins that you want to form in a staircase shape, where every k-th row must have exactly k coins. Given n, find the tot 阅读全文
posted @ 2016-11-01 11:35 SillyVicky 阅读(615) 评论(0) 推荐(0)