上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 25 下一页
摘要: 当使用trim()处理字符串后,发现 String index out of range: 0报错? 而且觉得代码无懈可击?一时想不出来什么时候会为空? 注意特殊情况处理的字符元素都是空格,eg:" "。空格被清除掉,可不就是空字符串吗,所以需要判断先你现在的String是不是空,再取下标~ 附小陌 阅读全文
posted @ 2018-12-15 21:05 Moliay 阅读(29) 评论(0) 推荐(0) 编辑
摘要: 原题链接https://leetcode.com/problems/string-to-integer-atoi/ 说实话,看到这道题之前,看这通过率有点慌,到底是因为啥 让一道medium的题目这么“厉害”咧,接着往下瞧~ problem description: Implement atoi w 阅读全文
posted @ 2018-12-15 18:33 Moliay 阅读(2) 评论(0) 推荐(0) 编辑
摘要: PS:①小陌笔记中蓝色紫色等一切花哨字体皆用来引入知识点(废话流),可忽略不计 。 ②黑字正文小陌竭力向言简意赅靠近再靠近。 ③红色字体小陌觉得重要的地方 (3)先执行case语句,后再判断default语句(在一路不匹配的情况下) switch语句(表达式) (1)表达式的取值是有限定的 ①开始是 阅读全文
posted @ 2018-12-10 21:21 Moliay 阅读(2) 评论(0) 推荐(0) 编辑
摘要: 话不多说,先看几段不报错的代码们 int x = 1; int y = 2; int z = 3; int max = x > y ? x > z ? x : z : y > z ? y : z; System.out.println(max);//3 int x = 1; int y = 2; i 阅读全文
posted @ 2018-12-10 17:04 Moliay 阅读(2) 评论(0) 推荐(0) 编辑
摘要: 原题链接https://leetcode.com/problems/reverse-integer/ 题目描述 Given a 32-bit signed integer, reverse digits of an integer. Example 1: Input: 123 Output: 321 阅读全文
posted @ 2018-12-10 12:39 Moliay 阅读(1) 评论(0) 推荐(0) 编辑
摘要: 原题链接https://leetcode.com/problems/zigzag-conversion/ 没开始看题目时,小陌发现这道题似乎备受嫌弃,被n多人踩了,还有点小同情 题目描述 The string "PAYPALISHIRING" is written in a zigzag patte 阅读全文
posted @ 2018-12-09 16:25 Moliay 阅读(1) 评论(0) 推荐(0) 编辑
摘要: 题目描述 Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. 给定一个字符串s,找出s中最长的回文子字符串。可假设s的最 阅读全文
posted @ 2018-12-08 16:51 Moliay 阅读(1) 评论(0) 推荐(0) 编辑
摘要: 题目描述 There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexi 阅读全文
posted @ 2018-12-07 20:11 Moliay 阅读(1) 评论(0) 推荐(0) 编辑
摘要: Fightingヾ(๑╹◡╹)ノ" IDQuestionDiff(1~5)Freq(1~5)Data StructureAlgorithms 1Two Sum25arraysort setTwo Pointers 2Add Two Numbers34linked listTwo Pointers M 阅读全文
posted @ 2018-12-07 11:32 Moliay 阅读(8) 评论(0) 推荐(0) 编辑
摘要: a = (a+b)-(b=a);//bingo 来自小猿的一时兴起,仅供娱乐~ 阅读全文
posted @ 2018-12-06 21:14 Moliay 阅读(1) 评论(0) 推荐(0) 编辑
上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 25 下一页