golang/

directory
v0.0.0-...-6c0d317 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 15, 2022 License: Apache-2.0

Directories

Path Synopsis
@lc code=start *
@lc code=start *
@lc code=start *
@lc code=start *
@lc code=start *
@lc code=start *
* @lc app=leetcode.cn id=125 lang=golang * * [125] 验证回文串 * * https://leetcode.cn/problems/valid-palindrome/description/ * * algorithms * Easy (46.90%) * Likes: 557 * Dislikes: 0 * Total Accepted: 391K * Total Submissions: 833.9K * Testcase Example: '"A man, a plan, a canal: Panama"' * * 给定一个字符串,验证它是否是回文串,只考虑字母和数字字符,可以忽略字母的大小写。
* @lc app=leetcode.cn id=125 lang=golang * * [125] 验证回文串 * * https://leetcode.cn/problems/valid-palindrome/description/ * * algorithms * Easy (46.90%) * Likes: 557 * Dislikes: 0 * Total Accepted: 391K * Total Submissions: 833.9K * Testcase Example: '"A man, a plan, a canal: Panama"' * * 给定一个字符串,验证它是否是回文串,只考虑字母和数字字符,可以忽略字母的大小写。
* @lc app=leetcode.cn id=137 lang=golang * * [137] 只出现一次的数字 II * * https://leetcode.cn/problems/single-number-ii/description/ * * algorithms * Medium (72.11%) * Likes: 893 * Dislikes: 0 * Total Accepted: 129.8K * Total Submissions: 180K * Testcase Example: '[2,2,3,2]' * * 给你一个整数数组 nums ,除某个元素仅出现 一次 外,其余每个元素都恰出现 三次 。
* @lc app=leetcode.cn id=137 lang=golang * * [137] 只出现一次的数字 II * * https://leetcode.cn/problems/single-number-ii/description/ * * algorithms * Medium (72.11%) * Likes: 893 * Dislikes: 0 * Total Accepted: 129.8K * Total Submissions: 180K * Testcase Example: '[2,2,3,2]' * * 给你一个整数数组 nums ,除某个元素仅出现 一次 外,其余每个元素都恰出现 三次 。
* @lc app=leetcode.cn id=713 lang=golang * * [713] 乘积小于 K 的子数组 * * https://leetcode.cn/problems/subarray-product-less-than-k/description/ * * algorithms * Medium (48.82%) * Likes: 577 * Dislikes: 0 * Total Accepted: 82K * Total Submissions: 168K * Testcase Example: '[10,5,2,6]\n100' * * 给你一个整数数组 nums 和一个整数 k ,请你返回子数组内所有元素的乘积严格小于 k 的连续子数组的数目。
* @lc app=leetcode.cn id=713 lang=golang * * [713] 乘积小于 K 的子数组 * * https://leetcode.cn/problems/subarray-product-less-than-k/description/ * * algorithms * Medium (48.82%) * Likes: 577 * Dislikes: 0 * Total Accepted: 82K * Total Submissions: 168K * Testcase Example: '[10,5,2,6]\n100' * * 给你一个整数数组 nums 和一个整数 k ,请你返回子数组内所有元素的乘积严格小于 k 的连续子数组的数目。
@lc code=start *
@lc code=start *
* @lc app=leetcode.cn id=1877 lang=golang * * [1877] 数组中最大数对和的最小值
* @lc app=leetcode.cn id=1877 lang=golang * * [1877] 数组中最大数对和的最小值
* @lc app=leetcode.cn id=208 lang=golang * * [208] 实现 Trie (前缀树) * * https://leetcode.cn/problems/implement-trie-prefix-tree/description/ *
* @lc app=leetcode.cn id=208 lang=golang * * [208] 实现 Trie (前缀树) * * https://leetcode.cn/problems/implement-trie-prefix-tree/description/ *
* @Author: yiGmMk marvelousme@163.com * @Date: 2022-07-27 18:19:52 * @LastEditors: yiGmMk marvelousme@163.com * @LastEditTime: 2022-07-27 18:19:53 * @FilePath: /go-tool/home/admin/code/coding-practicing/golang/209/209.长度最小的子数组.go * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @Author: yiGmMk marvelousme@163.com * @Date: 2022-07-27 18:19:52 * @LastEditors: yiGmMk marvelousme@163.com * @LastEditTime: 2022-07-27 18:19:53 * @FilePath: /go-tool/home/admin/code/coding-practicing/golang/209/209.长度最小的子数组.go * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @lc app=leetcode.cn id=29 lang=golang * * [29] 两数相除 * * https://leetcode.cn/problems/divide-two-integers/description/ * * algorithms * Medium (22.22%) * Likes: 943 * Dislikes: 0 * Total Accepted: 175.4K * Total Submissions: 789.3K * Testcase Example: '10\n3' * * 给定两个整数,被除数 dividend 和除数 divisor。
* @lc app=leetcode.cn id=29 lang=golang * * [29] 两数相除 * * https://leetcode.cn/problems/divide-two-integers/description/ * * algorithms * Medium (22.22%) * Likes: 943 * Dislikes: 0 * Total Accepted: 175.4K * Total Submissions: 789.3K * Testcase Example: '10\n3' * * 给定两个整数,被除数 dividend 和除数 divisor。
3
* @lc app=leetcode.cn id=3 lang=golang * * [3] 无重复字符的最长子串 * * https://leetcode.cn/problems/longest-substring-without-repeating-characters/description/ * * algorithms * Medium (38.93%) * Likes: 7969 * Dislikes: 0 * Total Accepted: 1.9M * Total Submissions: 4.9M * Testcase Example: '"abcabcbb"' * * 给定一个字符串 s ,请你找出其中不含有重复字符的 最长子串 的长度。
* @lc app=leetcode.cn id=3 lang=golang * * [3] 无重复字符的最长子串 * * https://leetcode.cn/problems/longest-substring-without-repeating-characters/description/ * * algorithms * Medium (38.93%) * Likes: 7969 * Dislikes: 0 * Total Accepted: 1.9M * Total Submissions: 4.9M * Testcase Example: '"abcabcbb"' * * 给定一个字符串 s ,请你找出其中不含有重复字符的 最长子串 的长度。
* @lc app=leetcode.cn id=304 lang=golang * * [304] 二维区域和检索 - 矩阵不可变 * * https://leetcode.cn/problems/range-sum-query-2d-immutable/description/ *
* @lc app=leetcode.cn id=304 lang=golang * * [304] 二维区域和检索 - 矩阵不可变 * * https://leetcode.cn/problems/range-sum-query-2d-immutable/description/ *
top k的问题首先应该想到用堆解决
top k的问题首先应该想到用堆解决
* @lc app=leetcode.cn id=412 lang=golang * * [412] Fizz Buzz * * https://leetcode.cn/problems/fizz-buzz/description/ * * algorithms * Easy (71.24%) * Likes: 198 * Dislikes: 0 * Total Accepted: 135K * Total Submissions: 190.5K * Testcase Example: '3' * * 给你一个整数 n ,找出从 1 到 n 各个整数的 Fizz Buzz 表示,并用字符串数组 answer(下标从 1 * 开始)返回结果,其中: * * * answer[i] == "FizzBuzz" 如果 i 同时是 3 和 5 的倍数。
* @lc app=leetcode.cn id=412 lang=golang * * [412] Fizz Buzz * * https://leetcode.cn/problems/fizz-buzz/description/ * * algorithms * Easy (71.24%) * Likes: 198 * Dislikes: 0 * Total Accepted: 135K * Total Submissions: 190.5K * Testcase Example: '3' * * 给你一个整数 n ,找出从 1 到 n 各个整数的 Fizz Buzz 表示,并用字符串数组 answer(下标从 1 * 开始)返回结果,其中: * * * answer[i] == "FizzBuzz" 如果 i 同时是 3 和 5 的倍数。
* @lc app=leetcode.cn id=421 lang=golang * * [421] 数组中两个数的最大异或值 * * https://leetcode.cn/problems/maximum-xor-of-two-numbers-in-an-array/description/ * * algorithms * Medium (62.04%) * Likes: 459 * Dislikes: 0 * Total Accepted: 39K * Total Submissions: 63K * Testcase Example: '[3,10,5,25,2,8]' * * 给你一个整数数组 nums ,返回 nums[i] XOR nums[j] 的最大运算结果,其中 0 ≤ i ≤ j < n 。
* @lc app=leetcode.cn id=421 lang=golang * * [421] 数组中两个数的最大异或值 * * https://leetcode.cn/problems/maximum-xor-of-two-numbers-in-an-array/description/ * * algorithms * Medium (62.04%) * Likes: 459 * Dislikes: 0 * Total Accepted: 39K * Total Submissions: 63K * Testcase Example: '[3,10,5,25,2,8]' * * 给你一个整数数组 nums ,返回 nums[i] XOR nums[j] 的最大运算结果,其中 0 ≤ i ≤ j < n 。
* @lc app=leetcode.cn id=438 lang=golang * * [438] 找到字符串中所有字母异位词 * * https://leetcode.cn/problems/find-all-anagrams-in-a-string/description/ * * algorithms * Medium (54.69%) * Likes: 962 * Dislikes: 0 * Total Accepted: 213.9K * Total Submissions: 390.9K * Testcase Example: '"cbaebabacd"\n"abc"' * * 给定两个字符串 s 和 p,找到 s 中所有 p 的 异位词 的子串,返回这些子串的起始索引。
* @lc app=leetcode.cn id=438 lang=golang * * [438] 找到字符串中所有字母异位词 * * https://leetcode.cn/problems/find-all-anagrams-in-a-string/description/ * * algorithms * Medium (54.69%) * Likes: 962 * Dislikes: 0 * Total Accepted: 213.9K * Total Submissions: 390.9K * Testcase Example: '"cbaebabacd"\n"abc"' * * 给定两个字符串 s 和 p,找到 s 中所有 p 的 异位词 的子串,返回这些子串的起始索引。
@lc code=start *
@lc code=start *
* @lc app=leetcode.cn id=525 lang=golang * * [525] 连续数组 * * https://leetcode.cn/problems/contiguous-array/description/ * * algorithms * Medium (54.47%) * Likes: 573 * Dislikes: 0 * Total Accepted: 58.7K * Total Submissions: 107.7K * Testcase Example: '[0,1]' * * 给定一个二进制数组 nums , 找到含有相同数量的 0 和 1 的最长连续子数组,并返回该子数组的长度。
* @lc app=leetcode.cn id=525 lang=golang * * [525] 连续数组 * * https://leetcode.cn/problems/contiguous-array/description/ * * algorithms * Medium (54.47%) * Likes: 573 * Dislikes: 0 * Total Accepted: 58.7K * Total Submissions: 107.7K * Testcase Example: '[0,1]' * * 给定一个二进制数组 nums , 找到含有相同数量的 0 和 1 的最长连续子数组,并返回该子数组的长度。
* @lc app=leetcode.cn id=304 lang=golang * * [304] 二维区域和检索 - 矩阵不可变 * * https://leetcode.cn/problems/range-sum-query-2d-immutable/description/ *
* @lc app=leetcode.cn id=304 lang=golang * * [304] 二维区域和检索 - 矩阵不可变 * * https://leetcode.cn/problems/range-sum-query-2d-immutable/description/ *
* @lc app=leetcode.cn id=567 lang=golang * * [567] 字符串的排列 * * https://leetcode.cn/problems/permutation-in-string/description/ * * algorithms * Medium (44.10%) * Likes: 735 * Dislikes: 0 * Total Accepted: 211.1K * Total Submissions: 478.6K * Testcase Example: '"ab"\n"eidbaooo"' * * 给你两个字符串 s1 和 s2 ,写一个函数来判断 s2 是否包含 s1 的排列。
* @lc app=leetcode.cn id=567 lang=golang * * [567] 字符串的排列 * * https://leetcode.cn/problems/permutation-in-string/description/ * * algorithms * Medium (44.10%) * Likes: 735 * Dislikes: 0 * Total Accepted: 211.1K * Total Submissions: 478.6K * Testcase Example: '"ab"\n"eidbaooo"' * * 给你两个字符串 s1 和 s2 ,写一个函数来判断 s2 是否包含 s1 的排列。
* @lc app=leetcode.cn id=648 lang=golang * * [648] 单词替换 * * https://leetcode.cn/problems/replace-words/description/ * * algorithms * Medium (59.98%) * Likes: 241 * Dislikes: 0 * Total Accepted: 57.4K * Total Submissions: 89K * Testcase Example: '["cat","bat","rat"]\n"the cattle was rattled by the battery"' * * 在英语中,我们有一个叫做 词根(root) 的概念,可以词根后面添加其他一些词组成另一个较长的单词——我们称这个词为 * 继承词(successor)。
* @lc app=leetcode.cn id=648 lang=golang * * [648] 单词替换 * * https://leetcode.cn/problems/replace-words/description/ * * algorithms * Medium (59.98%) * Likes: 241 * Dislikes: 0 * Total Accepted: 57.4K * Total Submissions: 89K * Testcase Example: '["cat","bat","rat"]\n"the cattle was rattled by the battery"' * * 在英语中,我们有一个叫做 词根(root) 的概念,可以词根后面添加其他一些词组成另一个较长的单词——我们称这个词为 * 继承词(successor)。
@lc code=start *
@lc code=start *
* @lc app=leetcode.cn id=66 lang=golang * * [66] 加一
* @lc app=leetcode.cn id=66 lang=golang * * [66] 加一
* @lc app=leetcode.cn id=724 lang=golang * * [724] 寻找数组的中心下标 * * https://leetcode.cn/problems/find-pivot-index/description/ * * algorithms * Easy (49.73%) * Likes: 445 * Dislikes: 0 * Total Accepted: 209.1K * Total Submissions: 420K * Testcase Example: '[1,7,3,6,5,6]' * * 给你一个整数数组 nums ,请计算数组的 中心下标 。
* @lc app=leetcode.cn id=724 lang=golang * * [724] 寻找数组的中心下标 * * https://leetcode.cn/problems/find-pivot-index/description/ * * algorithms * Easy (49.73%) * Likes: 445 * Dislikes: 0 * Total Accepted: 209.1K * Total Submissions: 420K * Testcase Example: '[1,7,3,6,5,6]' * * 给你一个整数数组 nums ,请计算数组的 中心下标 。
* @lc app=leetcode.cn id=729 lang=golang * * [729] 我的日程安排表 I * * https://leetcode.cn/problems/my-calendar-i/description/ * * algorithms * Medium (53.95%) * Likes: 123 * Dislikes: 0 * Total Accepted: 14.5K * Total Submissions: 26.8K * Testcase Example: '["MyCalendar","book","book","book"]\n[[],[10,20],[15,25],[20,30]]' * * 实现一个 MyCalendar 类来存放你的日程安排。
* @lc app=leetcode.cn id=729 lang=golang * * [729] 我的日程安排表 I * * https://leetcode.cn/problems/my-calendar-i/description/ * * algorithms * Medium (53.95%) * Likes: 123 * Dislikes: 0 * Total Accepted: 14.5K * Total Submissions: 26.8K * Testcase Example: '["MyCalendar","book","book","book"]\n[[],[10,20],[15,25],[20,30]]' * * 实现一个 MyCalendar 类来存放你的日程安排。
* @lc app=leetcode.cn id=76 lang=golang * * [76] 最小覆盖子串 * * https://leetcode.cn/problems/minimum-window-substring/description/ * * algorithms * Hard (44.58%) * Likes: 2052 * Dislikes: 0 * Total Accepted: 326.8K * Total Submissions: 732.1K * Testcase Example: '"ADOBECODEBANC"\n"ABC"' * * 给你一个字符串 s 、一个字符串 t 。
* @lc app=leetcode.cn id=76 lang=golang * * [76] 最小覆盖子串 * * https://leetcode.cn/problems/minimum-window-substring/description/ * * algorithms * Hard (44.58%) * Likes: 2052 * Dislikes: 0 * Total Accepted: 326.8K * Total Submissions: 732.1K * Testcase Example: '"ADOBECODEBANC"\n"ABC"' * * 给你一个字符串 s 、一个字符串 t 。
cli

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL