上一页 1 ··· 74 75 76 77 78 79 80 81 82 ··· 127 下一页

2020年6月7日

摘要: 地址 https://algospot.com/judge/problem/read/WILDCARD 解答 ? 比较好解决 比对两者字符串 字母一致则进到下一位 如果一个是?另一个无条件进到下一位 * 则比较麻烦 需要遍历的进行检验 如果w = *abc p1 = abc p2 = fabc p3 阅读全文
posted @ 2020-06-07 21:21 itdef 阅读(457) 评论(0) 推荐(0)

2020年6月6日

摘要: 地址 https://leetcode-cn.com/problems/longest-consecutive-sequence/ 给定一个未排序的整数数组,找出最长连续序列的长度。 要求算法的时间复杂度为 O(n)。 示例: 输入: [100, 4, 200, 1, 3, 2] 输出: 4 解释: 阅读全文
posted @ 2020-06-06 20:46 itdef 阅读(186) 评论(0) 推荐(0)

2020年5月31日

摘要: 地址 https://leetcode-cn.com/problems/symmetric-tree/ 给定一个二叉树,检查它是否是镜像对称的。 例如,二叉树 [1,2,2,3,4,4,3] 是对称的。 1 / \ 2 2 / \ / \ 3 4 4 3 但是下面这个 [1,2,2,null,3,n 阅读全文
posted @ 2020-05-31 12:03 itdef 阅读(236) 评论(0) 推荐(0)

2020年5月30日

摘要: 由于没时间参加 这里说下思路 1 通过翻转子数组使两个数组相等 比较两个数组是否能够通过转换子数组获得 其实就是比对里面的元素是否相同 排序并比较就好了 class Solution { public: bool canBeEqual(vector<int>& target, vector<int> 阅读全文
posted @ 2020-05-30 22:59 itdef 阅读(231) 评论(0) 推荐(0)

2020年5月27日

摘要: 地址 https://leetcode-cn.com/problems/subarray-sum-equals-k/ https://leetcode-cn.com/problems/subarray-sums-divisible-by-k/ 给定一个整数数组和一个整数 k,你需要找到该数组中和为  阅读全文
posted @ 2020-05-27 12:32 itdef 阅读(223) 评论(0) 推荐(0)

2020年5月24日

摘要: 地址 https://www.acwing.com/solution/LeetCode/content/13604/ 题目描述 给你一个字符串 sentence 作为句子并指定检索词为 searchWord ,其中句子由若干用 单个空格 分隔的单词组成。 请你检查检索词 searchWord 是否为 阅读全文
posted @ 2020-05-24 13:00 itdef 阅读(290) 评论(0) 推荐(0)
摘要: 地址 https://leetcode-cn.com/contest/weekly-contest-190/problems/maximum-number-of-vowels-in-a-substring-of-given-length/ 题目描述 给你字符串 s 和整数 k 。 请返回字符串 s 阅读全文
posted @ 2020-05-24 12:58 itdef 阅读(512) 评论(0) 推荐(0)
摘要: 地址 https://leetcode-cn.com/contest/weekly-contest-190/problems/pseudo-palindromic-paths-in-a-binary-tree/ 题目描述给你一棵二叉树,每个节点的值为 1 到 9 。我们称二叉树中的一条路径是 「伪回 阅读全文
posted @ 2020-05-24 12:16 itdef 阅读(385) 评论(0) 推荐(0)

2020年5月23日

摘要: 地址 https://www.acwing.com/problem/content/849/ 给定一个n个点m条边的有向图,图中可能存在重边和自环。 所有边的长度都是1,点的编号为1~n。 请你求出1号点到n号点的最短距离,如果从1号点无法走到n号点,输出-1。 输入格式 第一行包含两个整数n和m。 阅读全文
posted @ 2020-05-23 20:19 itdef 阅读(222) 评论(0) 推荐(0)
摘要: 地址 https://leetcode-cn.com/problems/minimum-window-substring/ 给你一个字符串 S、一个字符串 T,请在字符串 S 里面找出:包含 T 所有字符的最小子串。 示例: 输入: S = "ADOBECODEBANC", T = "ABC" 输出 阅读全文
posted @ 2020-05-23 16:38 itdef 阅读(207) 评论(0) 推荐(0)
上一页 1 ··· 74 75 76 77 78 79 80 81 82 ··· 127 下一页

导航