随笔分类 -  c++

摘要:来源:力扣(LeetCode)链接:https://leetcode-cn.com/problems/find-servers-that-handled-most-number-of-requests 题目描述 你有 k 个服务器,编号为 0 到 k-1 ,它们可以同时处理多个请求组。每个服务器有无 阅读全文
posted @ 2022-03-30 17:40 过客匆匆,沉沉浮浮 阅读(54) 评论(0) 推荐(0) 编辑
摘要:来源:力扣(LeetCode)链接:https://leetcode-cn.com/problems/first-missing-positive 题目描述 给你一个未排序的整数数组 nums ,请你找出其中没有出现的最小的正整数。 请你实现时间复杂度为 O(n) 并且只使用常数级别额外空间的解决方 阅读全文
posted @ 2022-03-29 14:59 过客匆匆,沉沉浮浮 阅读(84) 评论(0) 推荐(0) 编辑
摘要:来源:力扣(LeetCode)链接:https://leetcode-cn.com/problems/maximize-the-confusion-of-an-exam 题目描述 一位老师正在出一场由 n 道判断题构成的考试,每道题的答案为 true (用 'T' 表示)或者 false (用 'F 阅读全文
posted @ 2022-03-29 11:41 过客匆匆,沉沉浮浮 阅读(79) 评论(0) 推荐(0) 编辑
摘要:来源:力扣(LeetCode)链接:https://leetcode-cn.com/problems/valid-sudoku 题目描述 请你判断一个 9 x 9 的数独是否有效。只需要 根据以下规则 ,验证已经填入的数字是否有效即可。 数字 1-9 在每一行只能出现一次。数字 1-9 在每一列只能 阅读全文
posted @ 2022-03-28 09:01 过客匆匆,沉沉浮浮 阅读(34) 评论(0) 推荐(0) 编辑
摘要:来源:力扣(LeetCode)链接:https://leetcode-cn.com/problems/factorial-trailing-zeroes 题目描述 给定一个整数 n ,返回 n! 结果中尾随零的数量。 提示 n! = n * (n - 1) * (n - 2) * ... * 3 * 阅读全文
posted @ 2022-03-25 10:54 过客匆匆,沉沉浮浮 阅读(22) 评论(0) 推荐(0) 编辑
摘要:来源:力扣(LeetCode)链接:https://leetcode-cn.com/problems/sudoku-solver 题目描述 编写一个程序,通过填充空格来解决数独问题。 数独的解法需 遵循如下规则: 数字 1-9 在每一行只能出现一次。数字 1-9 在每一列只能出现一次。数字 1-9  阅读全文
posted @ 2022-03-24 11:25 过客匆匆,沉沉浮浮 阅读(46) 评论(0) 推荐(0) 编辑
摘要:来源:力扣(LeetCode)链接:https://leetcode-cn.com/problems/find-first-and-last-position-of-element-in-sorted-array 题目描述 给定一个按照升序排列的整数数组 nums,和一个目标值 target。找出给 阅读全文
posted @ 2022-03-24 09:13 过客匆匆,沉沉浮浮 阅读(31) 评论(0) 推荐(0) 编辑
摘要:来源:力扣(LeetCode)链接:https://leetcode-cn.com/problems/path-with-maximum-gold 题目描述 你要开发一座金矿,地质勘测学家已经探明了这座金矿中的资源分布,并用大小为 m * n 的网格 grid 进行了标注。每个单元格中的整数就表示这 阅读全文
posted @ 2022-03-23 11:47 过客匆匆,沉沉浮浮 阅读(56) 评论(0) 推荐(0) 编辑
摘要:来源:力扣(LeetCode)链接:https://leetcode-cn.com/problems/k-th-smallest-in-lexicographical-order 题目描述 给定整数 n 和 k,返回 [1, n] 中字典序第 k 小的数字。 示例 1: 输入: n = 13, k 阅读全文
posted @ 2022-03-23 10:31 过客匆匆,沉沉浮浮 阅读(61) 评论(0) 推荐(0) 编辑
摘要:来源:力扣(LeetCode)链接:https://leetcode-cn.com/problems/longest-valid-parentheses 题目描述 给你一个只包含 '(' 和 ')' 的字符串,找出最长有效(格式正确且连续)括号子串的长度。 示例 1: 输入:s = "(()"输出: 阅读全文
posted @ 2022-03-22 09:59 过客匆匆,沉沉浮浮 阅读(102) 评论(0) 推荐(0) 编辑
摘要:来源:力扣(LeetCode)链接:https://leetcode-cn.com/problems/remove-colored-pieces-if-both-neighbors-are-the-same-color 题目描述 总共有 n 个颜色片段排成一列,每个颜色片段要么是 'A' 要么是 ' 阅读全文
posted @ 2022-03-22 08:32 过客匆匆,沉沉浮浮 阅读(104) 评论(0) 推荐(0) 编辑
摘要:来源:力扣(LeetCode)链接:https://leetcode-cn.com/problems/the-time-when-the-network-becomes-idle 题目描述 给你一个有 n 个服务器的计算机网络,服务器编号为 0 到 n - 1 。同时给你一个二维整数数组 edges 阅读全文
posted @ 2022-03-21 10:11 过客匆匆,沉沉浮浮 阅读(49) 评论(0) 推荐(0) 编辑
摘要:来源:力扣(LeetCode)链接:https://leetcode-cn.com/problems/search-in-rotated-sorted-array 题目描述 整数数组 nums 按升序排列,数组中的值 互不相同 。 在传递给函数之前,nums 在预先未知的某个下标 k(0 <= k 阅读全文
posted @ 2022-03-19 14:50 过客匆匆,沉沉浮浮 阅读(25) 评论(0) 推荐(0) 编辑
摘要:来源:力扣(LeetCode)链接:https://leetcode-cn.com/problems/simple-bank-system 题目描述 你的任务是为一个很受欢迎的银行设计一款程序,以自动化执行所有传入的交易(转账,存款和取款)。银行共有 n 个账户,编号从 1 到 n 。每个账号的初始 阅读全文
posted @ 2022-03-18 08:44 过客匆匆,沉沉浮浮 阅读(37) 评论(0) 推荐(0) 编辑
摘要:来源:力扣(LeetCode)链接:https://leetcode-cn.com/problems/substring-with-concatenation-of-all-words 题目描述 给定一个字符串 s 和一些 长度相同 的单词 words 。找出 s 中恰好可以由 words 中所有单 阅读全文
posted @ 2022-03-17 15:05 过客匆匆,沉沉浮浮 阅读(25) 评论(0) 推荐(0) 编辑
摘要:来源:力扣(LeetCode)链接:https://leetcode-cn.com/problems/next-permutation 题目描述 整数数组的一个 排列 就是将其所有成员以序列或线性顺序排列。 例如,arr = [1,2,3] ,以下这些都可以视作 arr 的排列:[1,2,3]、[1 阅读全文
posted @ 2022-03-17 11:43 过客匆匆,沉沉浮浮 阅读(27) 评论(0) 推荐(0) 编辑
摘要:来源:力扣(LeetCode)链接:https://leetcode-cn.com/problems/divide-two-integers 题目描述 给定两个整数,被除数 dividend 和除数 divisor。将两数相除,要求不使用乘法、除法和 mod 运算符。 返回被除数 dividend  阅读全文
posted @ 2022-03-16 17:23 过客匆匆,沉沉浮浮 阅读(68) 评论(0) 推荐(0) 编辑
摘要:来源:力扣(LeetCode)链接:https://leetcode-cn.com/problems/all-oone-data-structure 题目描述 请你设计一个用于存储字符串计数的数据结构,并能够返回计数最小和最大的字符串。 实现 AllOne 类: AllOne() 初始化数据结构的对 阅读全文
posted @ 2022-03-16 15:01 过客匆匆,沉沉浮浮 阅读(70) 评论(0) 推荐(0) 编辑
摘要:来源:力扣(LeetCode)链接:https://leetcode-cn.com/problems/reverse-nodes-in-k-group 题目描述 给你一个链表,每 k 个节点一组进行翻转,请你返回翻转后的链表。 k 是一个正整数,它的值小于或等于链表的长度。 如果节点总数不是 k 的 阅读全文
posted @ 2022-03-15 13:39 过客匆匆,沉沉浮浮 阅读(32) 评论(0) 推荐(0) 编辑
摘要:来源:力扣(LeetCode)链接:https://leetcode-cn.com/problems/count-number-of-maximum-bitwise-or-subsets 题目描述 给你一个整数数组 nums ,请你找出 nums 子集 按位或 可能得到的 最大值 ,并返回按位或能得 阅读全文
posted @ 2022-03-15 09:07 过客匆匆,沉沉浮浮 阅读(94) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示