摘要:
题目:Given a linked list, remove thenthnode from the end of list and return its head.For example, Given linked list: 1->2->3->4->5, and n = 2. After... 阅读全文
摘要:
题目:Write a function to find the longest common prefix string amongst an array of strings.代码:class Solution {public: string longestCommonPrefix(vect... 阅读全文
摘要:
题目:Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.提示:此题只要熟悉罗马数字的书写语法,做起来就不会太难,关于罗马数字的介绍可以参考... 阅读全文
摘要:
题目:The string"PAYPALISHIRING"is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font... 阅读全文
摘要:
题目:Determine whether an integer is a palindrome. Do this without extra space.提示:此题需要注意负数不是回文数。另外,我一开始的思路是把输入数字通过整除和取模运算把它倒转过来与原数字进行比较(不用考虑倒转过来的数字会不会溢出... 阅读全文
摘要:
题目:Implementatoito convert a string to an integer.Hint:Carefully consider all possible input cases. If you want a challenge, please do not see below a... 阅读全文
摘要:
题目:Reverse digits of an integer.Example1:x = 123, return 321Example2:x = -123, return -321Have you thought about this?Here are some good questions to ... 阅读全文