随笔分类 -  LeetCode

上一页 1 2

摘要:Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in-place. 来源:力扣(LeetCode)链接:https://leetcode-cn.com/problems/set-m 阅读全文

posted @ 2019-09-01 17:54 Jain_Shaw 阅读(159) 评论(0) 推荐(0)

摘要:Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum. Example: Inpu 阅读全文

posted @ 2019-08-21 00:18 Jain_Shaw 阅读(182) 评论(0) 推荐(0)

摘要:Given a string, find the length of the longest substring without repeating characters. 来源:力扣(LeetCode)链接:https://leetcode-cn.com/problems/longest-subs 阅读全文

posted @ 2019-08-16 22:26 Jain_Shaw 阅读(152) 评论(0) 推荐(0)

摘要://原题来自LeetCode 给定一个字符串,返回其中最长的回文子字符串 这道题目前目前受限于能力,暂时只能通过最暴力的解法来求得其解,即遍历子字符串,找出满足条件的解。下面是未曾优化过的代码,超出了时间限制的,囧(96 / 103 个通过测试用例) 这个思路很直接,不过就是要经过几次遍历,耗时太久 阅读全文

posted @ 2019-08-05 22:38 Jain_Shaw 阅读(415) 评论(0) 推荐(0)

摘要: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 inp 阅读全文

posted @ 2019-07-31 21:28 Jain_Shaw 阅读(136) 评论(0) 推荐(0)

摘要:回文串,就是说给出的字符串中的字符是否对称,即:第一个字符与最后一个字符相等,第二个字符等于倒数第二个字符,以此类推,忽略大小写以及标点符号。 e.g: 这段代码运行的时间和占用的内存好像并不稳定,试过提交几次得到的结果都并不相同。在最后的循环判断那里,虽然我只是觉得注释所说的方法所需要的时间更长, 阅读全文

posted @ 2019-07-06 23:04 Jain_Shaw 阅读(312) 评论(0) 推荐(0)

上一页 1 2

导航