2019年9月15日

摘要: Given an array with n objects colored red, white or blue, sort them in-place so that objects of the same color are adjacent, with the colors in the or 阅读全文
posted @ 2019-09-15 22:58 Jain_Shaw 阅读(187) 评论(0) 推荐(0) 编辑

2019年9月14日

摘要: Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties: Integers in each row are sorted f 阅读全文
posted @ 2019-09-14 02:49 Jain_Shaw 阅读(1020) 评论(0) 推荐(0) 编辑

2019年9月1日

摘要: 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 阅读(152) 评论(0) 推荐(0) 编辑

2019年8月21日

摘要: 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 阅读(177) 评论(0) 推荐(0) 编辑

2019年8月16日

摘要: 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 阅读(146) 评论(0) 推荐(0) 编辑

2019年8月5日

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

2019年7月31日

摘要: 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 阅读(130) 评论(0) 推荐(0) 编辑

2019年7月6日

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

导航