摘要: 问题描述: You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the qua 阅读全文
posted @ 2015-12-16 21:55 江湖凶险 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 问题描述: Given a non-negative number represented as an array of digits, plus one to the number. The digits are stored such that the most significant digi 阅读全文
posted @ 2015-12-16 16:47 江湖凶险 阅读(136) 评论(0) 推荐(0) 编辑
摘要: 问题描述: Reverse digits of an integer. Example1: x = 123, return 321Example2: x = -123, return -321 分析:将一个整数逆序输出,需要判断是否越界。Integer.MAX_VALUE,Integer.MIN_V 阅读全文
posted @ 2015-12-16 16:23 江湖凶险 阅读(212) 评论(0) 推荐(0) 编辑
摘要: 问题描述: Given an integer, write a function to determine if it is a power of two. 问题分析:给定一个数,判断它是不是2的幂。因为2的幂 >= 0 ,所以是针对非负数的。那么这个数 %2为0 代码: 阅读全文
posted @ 2015-12-16 15:28 江湖凶险 阅读(120) 评论(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 sp 阅读全文
posted @ 2015-12-16 14:40 江湖凶险 阅读(108) 评论(0) 推荐(0) 编辑