
LeetCode
coffeesweet
这个作者很懒,什么都没留下…
展开
-
E299:Bulls and Cows(字符串处理)
You are playing the following Bulls and Cows game with your friend: You write down a number and ask your friend to guess what the number is. Each time your friend makes a guess, you provide a hint t原创 2016-01-13 22:57:40 · 476 阅读 · 0 评论 -
E326:判断一个数是3的幂
第一次用Java做leetcode试题, Java的Int类型为32位范围为-2147483648——2147483647, 而3在32位里最大为1162261467(3的19次方) 所以用1162261467去除n取余 public class Solution { public boolean isPowerOfThree(int n) { return n>0原创 2016-01-13 16:30:35 · 1565 阅读 · 0 评论