- 博客(9)
- 收藏
- 关注
原创 [LeetCode]9.Palindrome Number
文章目录题目描述解题方案1 逆序整数2 左右指针题目描述Determine whether an integer is a palindrome. An integer is a palindrome when it reads the same backward as forward.Example 1:Input: 121Output: trueExample 2:Input: ...
2019-06-12 11:27:08
129
原创 [LeetCode]7.inverse
文章目录题目描述代码题目描述将一个整数转化为逆序输出,比如123转为321,-123转为-321注意整数溢出代码int reverse(int x){int res=0;int temp=0;while(x!=0){temp=res*10+x%10;if((temp-x%10)/10!=res){return 0;}res=temp;x/=10;}return re...
2019-06-11 05:01:07
114
原创 [LeetCode]4.ZigZag
内容描述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 for better legibility)P A H NA P L...
2019-06-10 21:21:43
103
原创 [LeetCode]5.longestPalindrome
longestPalindrome最长回文串问题描述Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.Example 1:Input: “babad”Output: “bab”Note: “aba” is a...
2019-05-25 20:57:49
163
原创 [LeetCode]3.lengthOfLongestSubstring
Given a string, find the length of the longest substring without repeating characters.Example 1:Input: "abcabcbb"Output: 3 Explanation: The answer is "abc", with the length of 3. Example 2:I...
2019-05-24 18:04:32
218
原创 [LeetCode]2. Add two num
LeetCode 2. Add two num内容描述给定两个链表代表两个非负数,求这两个数的和(2 -> 4 -> 3) + (5 -> 6 -> 4)因为 342 + 465 = 807所以返回 7 -> 0 -> 8注意进位!class ListNode {public: int val; ListNode *next;...
2019-05-23 16:55:58
290
原创 [LeetCode]1.Two Sum
给定 nums = [2, 7, 11, 15], target = 9因为 nums[0] + nums[1] = 2 + 7 = 9所以返回 [0, 1]解决方案:使用map容器,遍历数组如果target-nums[i]在容器中,则返回相应结果,否则向容器添加元素vector<int> twoSum(const vector<int> &am...
2019-05-23 16:03:15
82
原创 ServletContext,ActionContext和ServletActionContext比较
首先来源不同,ServletContext来源于标准J2EE,是Servlet的最大接口,最常见的实现是jsp的application。而ActionContext和ServletActionContext来源于Struts。ActionContext就是为了弥补strtus2 action跳出标准servlet框架而造成的和WEB环境失去联系的缺陷(引用)。ServletActionCont
2016-08-14 20:18:45
244
原创 Spring五种事务配置
Spring配置文件中关于事务配置总是由三个组成部分,分别是DataSource、TransactionManager和代理机制这三部分,无论哪种配置方式,一般变化的只是代理机制这部分。 DataSource、TransactionManager这两部分只是会根据数据访问方式有所变化,比如使用Hibernate进行数据访问时,DataSource实际为SessionFactory,T
2016-08-08 16:58:37
358
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人