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-01-12 00:25:55
阅读次数:
197
题目:
The gray code is a binary numeral system where two successive values differ in only one bit.
Given a non-negative integer n representing the total number of bits in the code, print the seque...
分类:
编程语言 时间:
2015-01-11 12:27:43
阅读次数:
282
Given amxngrid filled with non-negative numbers, find a path from top left to bottom right whichminimizesthe sum of all numbers along its path. ...
分类:
其他好文 时间:
2015-01-09 09:10:42
阅读次数:
176
Given n non-negative integers a1, a2,
..., an, where each represents a point at coordinate (i, ai). n vertical
lines are drawn such that the two endpoints of line i is at (i, ai) and (i,
0). Fin...
分类:
其他好文 时间:
2015-01-08 22:50:27
阅读次数:
207
问题描述:
Given n non-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of largest rectangle in the histogram.
Above is a histogram where wi...
分类:
其他好文 时间:
2015-01-08 22:49:39
阅读次数:
316
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-01-07 20:54:50
阅读次数:
140
题目:
Given a list, rotate the list to the right by k places, where k is non-negative.
For example:
Given 1->2->3->4->5->NULL and k = 2,
return 4->5->1->2->3->NULL.
给出一个链表,和一个非负数k, 要求从链表尾节点开始...
分类:
编程语言 时间:
2015-01-07 18:55:05
阅读次数:
196
The problem: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...
分类:
其他好文 时间:
2015-01-07 12:57:33
阅读次数:
124
The gray code is a binary numeral system where two successive values differ in only one bit.Given a non-negative integer n representing the total numb...
分类:
其他好文 时间:
2015-01-06 19:55:57
阅读次数:
159
题目:
Given two numbers represented as strings, return multiplication of the numbers as a string.
Note: The numbers can be arbitrarily large and are non-negative.
Answer 1:
基础法
大整数...
分类:
编程语言 时间:
2015-01-06 10:11:54
阅读次数:
222