FiveWords
FiveWords
全部文章
LeetCode
归档
标签
去牛客网
登录
/
注册
FiveWords的博客
EdgeOfEternity
全部文章
/ LeetCode
(共7篇)
LeetCode161周赛第四题
5250. 检查好数组 题目描述 给你一个正整数数组 nums,你需要从中任选一些子集,然后将子集中每一个数乘以一个 任意整数,并求出他们的和。假如该和结果为 1,那么原数组就是一个「好数组」,则返回 True;否则请返回False。 示例 示例1: 输入:nums = [12,5,7,23]输出:...
LeetCode
数论
2019-11-04
0
522
LeetCode161周赛第三题
1249. 移除无效的括号 题目描述 给你一个由 ‘(’、’)’ 和小写字母组成的字符串 s。 你需要从字符串中删除最少数目的 ‘(’ 或者 ‘)’ (可以删除任意位置的括号),使得剩下的「括号字符串」有效。 请返回任意一个合法字符串。 有效「括号字符串」应当符合以下 任意一条 要求: ...
括号匹配
2019-11-04
0
552
LeetCode161周赛第二题
1248. 统计「优美子数组」 题目描述 给你一个整数数组 nums 和一个整数 k。 如果某个 连续 子数组中恰好有 k 个奇数数字,我们就认为这个子数组是「优美子数组」。 请返回这个数组中「优美子数组」的数目。 题目点击这里 示例 示例 1: 输入:nums = [1,1,2,1,1]...
LeetCode
周赛
前缀和
2019-11-04
0
511
LeetCode161周赛-第一题
1247. 交换字符使得字符串相同 题目描述: 有两个长度相同的字符串 s1 和 s2,且它们其中 只含有 字符 “x” 和 “y”,你需要通过「交换字符」的方式使这两个字符串相同。 每次「交换字符」的时候,你都可以在两个字符串中各选一个字符进行交换。 交换只能发生在两个不同的字符串之间,绝...
2019-11-04
0
587
leetcode-25. Reverse Nodes in k-Group
Given a linked list, reverse the nodes of a linked list k at a time and return its modified list. k is a positive integer and is less than or equal t...
2018-09-22
0
480
LeetCode-29. Divide Two Integers
Given two integers dividend and divisor, divide two integers without using multiplication, division and mod operator. Return the quotient after divid...
2018-09-22
0
582
LeetCode-28. Implement strStr()
Implement strStr(). Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. Example 1: Input: hay...
2018-09-22
0
524