LeetCode刷题日记
爱吃章鱼的怪兽
这个作者很懒,什么都没留下…
展开
-
LeetCode刷题日记 #20 有效的括号 Valid Parentheses
Given a string s containing just the characters ‘(’, ‘)’, ‘{’, ‘}’, ‘[’ and ‘]’, determine if the input string is valid.An input string is valid if:Open brackets must be closed by the same type of brackets.Open brackets must be closed in the correct ord原创 2021-05-30 18:09:18 · 103 阅读 · 0 评论 -
AddressSanitizer:deadlysignal
在leetcode做题报出这个错地址杀毒剂???黑人问号看见SEGV才发现应该是内存的问题发现我的&&逻辑符的问题????菜狗狂怒原创 2021-05-30 18:05:08 · 1192 阅读 · 3 评论 -
LeetCode刷题日记 #14最长公共前缀
我水水水水class Solution {public: string longestCommonPrefix(vector<string>& strs) { bool is=1; string re=""; char t; for(int i=0;i<strs[0].length();i++) { for(int j=0;j&原创 2021-05-27 10:06:36 · 108 阅读 · 0 评论 -
LeetCode刷题笔记#13罗马数字转整数 Roman to Integer
每日刷一道题好吧我就是来水博客的Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M.Symbol ValueI 1V 5X 10L 50C 100D 500M 1000For example, 2原创 2021-05-24 22:14:49 · 156 阅读 · 0 评论 -
LeetCode刷题笔记 #9回文数 Palindrome Number
腹泻 难受我好菜,我就是来水文章的Given an integer x, return true if x is palindrome integer.An integer is a palindrome when it reads the same backward as forward. For example, 121 is palindrome while 123 is not.class Solution {public: bool isPalindrome(int x) {原创 2021-05-04 18:34:15 · 115 阅读 · 0 评论 -
LeetCode刷题笔记#7 整数反转 Reverse Integer
Given a signed 32-bit integer x, return x with its digits reversed. If reversing x causes the value to go outside the signed 32-bit integer range [-231, 231 - 1], then return 0.Assume the environment does not allow you to store 64-bit integers (signed or.原创 2021-04-22 22:45:39 · 220 阅读 · 0 评论 -
LeetCode刷题笔记#1 两数之和 twoSum
有人相爱,有人夜里看海,有人leetcode第一题做不出来进入leetcode刷题算法阶段了,离学期结束不远了,写博客记录一下自己的成长,任务比较多。尽量坚持吧。先上题目Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target.You may assume that each input would have e.原创 2021-04-21 22:01:02 · 280 阅读 · 0 评论