摘要:/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; *...
阅读全文
摘要:class Solution {public: bool isPalindrome(int x) { if(x < 0) return false; if(x < 10) return true; int temp1; int temp2...
阅读全文
摘要:class Solution {public: string intToRoman(int num) { string a[10] = {"","I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX"}; stri...
阅读全文
摘要:class Solution {public: int myAtoi(string str) { long long sum = 0; int temp1 = 1; int max1 = 0x7fffffff; int min1 = ...
阅读全文
摘要:1 class Solution { 2 public: 3 string convert(string s, int numRows) { 4 if(numRows <= 1 || s.size() == 0) 5 return s; 6 ...
阅读全文
摘要:1 、Two Sum 2、Add Two Numbers 3、Longest Substring Without Repeating Characters 7、Reverse Integer 26、Remove Duplicates from Sorted Array 由于 一道道加 略麻烦,所以打
阅读全文