摘要:
int func(int n){ if (n ==0) return 0; if (n == 1) return 1; int p = 0; int q = 1; for (int i = 1; i < n; i++){ int... 阅读全文
2015年4月12日
摘要:
Title : Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three i 阅读全文
摘要:
Title: Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the 阅读全文
摘要:
Title : https://leetcode.com/problems/container-with-most-water/ Given n non-negative integers a1, a2, ..., an, where each represents a point at coord 阅读全文
摘要:
Title : Determine whether an integer is a palindrome. Do this without extra space. 思路1 : 将数字翻转,然后看是否相等。是否越界的问题,如果真是回文串是不会越界的 思路2: 从左右两边分别验证是否相等 阅读全文
摘要:
Title : Implement atoi to convert a string to an integer. Hint: Carefully consider all possible input cases. If you want a challenge, please do not se 阅读全文
2015年4月11日
摘要:
Title : Reverse digits of an integer. Example1: x = 123, return 321Example2: x = -123, return -321 主要注意的问题是防止数组越界的问题。还有通过除法、取模计算的要记住 阅读全文
摘要:
Title :Longest Palindromic SubstringGiven a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, an... 阅读全文
2012年4月27日