摘要: Validate if a given string is numeric. Some examples: "0" => true " 0.1 " => true "abc" => false "1 a" => false "2e10" => true Note: It is intended fo 阅读全文
posted @ 2015-06-15 11:24 linqiaozhou 阅读(249) 评论(0) 推荐(0) 编辑
摘要: Implement int sqrt(int x). Compute and return the square root of x. 转自:http://blog.csdn.net/doc_sgl/article/details/12404971 实际面试遇到的题目可能不是对一个整数开方,而是对一 阅读全文
posted @ 2015-06-14 10:40 linqiaozhou 阅读(728) 评论(0) 推荐(0) 编辑
摘要: You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single 阅读全文
posted @ 2015-06-14 10:28 linqiaozhou 阅读(254) 评论(0) 推荐(0) 编辑
摘要: Given two numbers represented as strings, return multiplication of the numbers as a string. Note: The numbers can be arbitrarily large and are non-neg 阅读全文
posted @ 2015-06-11 17:16 linqiaozhou 阅读(288) 评论(0) 推荐(0) 编辑
摘要: Given an integer, convert it to a roman numeral. Input is guaranteed to be within the range from 1 to 3999. 没认真想,看到一种方法,应该算是最简单的方法了吧 基础知识: 罗马数字是由字符I,V 阅读全文
posted @ 2015-06-11 16:50 linqiaozhou 阅读(250) 评论(0) 推荐(0) 编辑
摘要: Divide two integers without using multiplication, division and mod operator. If it is overflow, return MAX_INT. 这道题属于数值处理的题目,对于整数处理的问题,比较重要的注意点在于符号和处理 阅读全文
posted @ 2015-06-11 16:26 linqiaozhou 阅读(677) 评论(0) 推荐(0) 编辑
摘要: Given two integers representing the numerator and denominator of a fraction, return the fraction in string format. If the fractional part is repeating 阅读全文
posted @ 2015-06-11 14:59 linqiaozhou 阅读(262) 评论(0) 推荐(0) 编辑
摘要: Implement pow(x, n). 下面介绍一下解决该问题的几种方法以及要注意的地方: 1)最直观容易想到的方法就是用递归方法求n个x的乘积,注意考虑n的正负号,时间复杂度为O(n) class Solution { public: double myPow(double x, int n) 阅读全文
posted @ 2015-06-11 11:23 linqiaozhou 阅读(574) 评论(0) 推荐(0) 编辑
摘要: Given an integer n, return the number of trailing zeroes in n!. Note: Your solution should be in logarithmic time complexity. 转自:http://blog.csdn.net/ 阅读全文
posted @ 2015-06-11 11:10 linqiaozhou 阅读(207) 评论(0) 推荐(0) 编辑
摘要: Excel Sheet Column Title Given a positive integer, return its corresponding column title as appear in an Excel sheet. For example: Python版: 1,10进制转成26 阅读全文
posted @ 2015-06-11 10:35 linqiaozhou 阅读(288) 评论(0) 推荐(0) 编辑