leetcode
文章平均质量分 62
summer_liuwei
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Excel Sheet Column Title
Excel Sheet Column Title 递归实现,当n % 26 == 0时需要特殊处理,讲对应位置Z。 class Solution { public: string convertToTitle(int n) { string s; if (n <= 0) { return s;原创 2015-04-04 18:47:24 · 563 阅读 · 0 评论 -
Power of Two
Power of Two Given an integer, write a function to determine if it is a power of two.class Solution { public: bool isPowerOfTwo(int n) { if (n <= 0) { return false;原创 2015-07-29 22:19:55 · 442 阅读 · 0 评论 -
Palindrome Number
Determine whether an integer is a palindrome. Do this without extra space. click to show spoilers. Some hints: Could negative integers be palindromes? (ie, -1) If you are thinking of convertin原创 2015-05-02 21:16:34 · 456 阅读 · 0 评论 -
String to Integer (atoi)
Implement atoi to convert a string to an integer. Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possible input ca原创 2015-05-02 20:24:10 · 459 阅读 · 0 评论 -
Number of 1 Bits
Write a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as the Hamming weight). For example, the 32-bit integer ’11' has binary representation 000000原创 2015-04-09 22:22:19 · 495 阅读 · 0 评论 -
Two Sum
Given an array of integers, find two numbers such that they add up to a specific target number. The function twoSum should return indices of the two numbers such that they add up to the target, whe原创 2015-04-07 23:24:14 · 559 阅读 · 0 评论 -
Add Two Numbers
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 digit. Add the two numbers and return it as a link原创 2015-04-11 20:48:35 · 554 阅读 · 0 评论 -
Reverse Integer
Reverse digits of an integer. Example1: x = 123, return 321 Example2: x = -123, return -321 click to show spoilers. Have you thought about this? Here are some good questions to ask before原创 2015-04-11 21:51:47 · 559 阅读 · 0 评论 -
Excel Sheet Column Number
Given a column title as appear in an Excel sheet, return its corresponding column number.For example: A -> 1 B -> 2 C -> 3 ... Z -> 26 AA -> 27 AB -> 28 class Solution {原创 2015-04-05 09:50:12 · 488 阅读 · 0 评论 -
leetcode 227: Basic Calculator II
Implement a basic calculator to evaluate a simple expression string. The expression string contains only non-negative integers, +, -, *, / operators and empty spaces . The integer division should原创 2015-10-24 11:49:23 · 1486 阅读 · 0 评论
分享