![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
刷题
没见过的流川枫
这个作者很懒,什么都没留下…
展开
-
leetcode刷题笔记 647. Palindromic Substrings -------我是真滴菜
今天做了一会实验,觉得效果很差,心情也很糟,刷刷题,进行心灵上的二次洗礼。 今天的题目是看一个字符串中回文的数目。 For example: 输入:“a b c” 输出:3 分别是:“a”, "b", "c" 输入:“aaa” 输出:6 分别是:"a", "a", "a", "aa", "aa", "aaa"原创 2019-01-10 22:30:45 · 96 阅读 · 0 评论 -
Leetcode 46 全排列 --- 我觉得我不能更菜了
一,题目描述: 给定一个没有重复数字的序列,返回其所有可能的全排列。 示例: 输入: [1,2,3] 输出: [ [1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], [3,2,1] ] 二.思路解析 本题中主要想法是对数组中的元素进行交换。 基本想法是:固定一部分的值,认为是已经处理好的,剩下的部分是我想继续交换的部...原创 2019-03-07 00:22:25 · 103 阅读 · 0 评论 -
leetcode 239.输出窗口中最大值的集合 C++版本
题目:给定一个数组,有一个长度为k滑动的窗口从左往右走,每一次滑动一次,返回滑动窗口在滑动过程中的最大值们。 class Solution { public: vector<int> maxSlidingWindow(vector<int>& nums, int k) { // res用来存储结果 vector&l...原创 2019-03-10 20:44:59 · 265 阅读 · 0 评论 -
leetcode--394. Decode String
题目描述: 使用深度优先遍历方法 class Solution { public: string decodeString(string s) { string res = ""; int a = 0; return helper(a, s); } string h...原创 2019-04-10 21:45:37 · 122 阅读 · 0 评论 -
leetcode随笔 Wildcard Matching
class Solution { public: bool isMatch(const char *s, const char *p) { int i = 0; int j = 0; int ri = -1; int rj = -1; int n = strlen(s); int m = str...原创 2019-06-20 16:27:10 · 108 阅读 · 0 评论