文章
【Leetcode】16. 3Sum Closest 集合中选三个元素之和最接近指定值
1.题目GivenanarraySofnintegers,findthreeintegersinSsuchthatthesumisclosesttoagivennumber,target.Returnthesumofthethre
【Leetcode】15. 3Sum 集合中选三个元素之和等于0
1.题目GivenanarraySofnintegers,arethereelementsa,b,cinSsuchthatabc0?Findalluniquetripletsinthearraywhichgives
【Leetcode】14. Longest Common Prefix 两个字符串的最长公共前缀长度
1.题目Writeafunctiontofindthelongestcommonprefixstringamongstanarrayofstrings.2.思路遍历按序逐个比较,直接了当。3.代码耗时:6ms<p
【Leetcode】13. Roman to Integer 罗马数字转阿拉伯数字
1.题目Givenaromannumeral,convertittoaninteger.Inputisguaranteedtobewithintherangefrom1to3999.2.思路按序累加即可。考虑{4、9}10
【Leetcode】12. Integer to Roman 阿拉伯数字转罗马数字
1.题目Givenaninteger,convertittoaromannumeral.Inputisguaranteedtobewithintherangefrom1to3999.2.思路罗马数字的规则:字符:M
【Leetcode】11. Container With Most Water 数列中选两个值使得中间的面积最大
1.题目Givennnonnegativeintegersa1,a2,...,an,whereeachrepresentsapointatcoordinate(i,ai).nverticallinesaredrawnsuchthatth
【leetcode】10. Regular Expression Matching 简易正则匹配
1.题目Implementregularexpressionmatchingwithsupportfor&39;.&39;and&39;&39;.&39;.&39;Matchesanysinglecharacter.&39;&39;M
【Leetcode】9. Palindrome Number 判断一个数字是否是回文数字
1.题目Determinewhetheranintegerisapalindrome.Dothiswithoutextraspace.2.思路反转后和自身比较是否相等。不需要考虑溢出,因为如果是回文就不会溢出。如果溢出一定不是。3.
【Leetcode】8. String to Integer (atoi) 字符串转整型
1.题目Implementatoitoconvertastringtoaninteger.Hint:Carefullyconsiderallpossibleinputcases.Ifyouwantachallenge,pleasedono
【Leetcode】7. Reverse Integer 整数字面反转
1.题目Reversedigitsofaninteger.Example1:x123,return321Example2:x123,return3212.思路如果是负数,先转换为正数在处理,处理之后再补上符号位。通过模10、余
已加载文章中没有匹配内容,试试其他关键词或清空搜索。