🚀 A collection of my solutions to LeetCode problems, organized by question number. Continuously updated as I tackle new challenges to sharpen my coding skills. leetcode.com/u/Elviax/ Resources Readme Acti
我的LeetCode代码仓,近乎所有题目都会提供多种解法 :). Contribute to 617076674/LeetCode development by creating an account on GitHub.
Write a program to check whether a given number is an ugly number. Ugly numbers are positive numbers whose prime factors only include2, 3, 5. For example,6, 8are ugly while14is not ugly since it includes another prime factor7. Note that1is typically treated as an ugly number. 这是今天...
3. [LeetCode] Missing Number (A New Questions Added Today)(310) 4. [LeetCode] Add Digits (a New question added)(305) 5. [LeetCode] Swap Nodes in Pairs(303) 评论排行榜 1. [LeetCode] Happy Number(2) 最新评论 1. Re:[LeetCod] Happy Number 依然没对。难道我花眼了 --t0t0 2...
We also have a variable size which is here to store the number of elements in our list. https://gist.github.com/RakhmedovRS/f18182ba692a76502f4444bf58410af6 https://gist.github.com/RakhmedovRS/b84d3c5758832540450b394dd69d85d2 The next method is void addAtTail(int val) it does ...
leetcode_question_115 Distinct Subsequences Given a stringSand a stringT, count the number of distinct subsequences ofTinS. A subsequence of a string is a new string which is formed from the original string by deleting some (can be none) of the characters without disturbing the relative ...
输入:nums = [1,2,3,4,5], m = 2 输出:9 示例3: 输入:nums = [1,4,4], m = 3 输出:4 提示: 1 <= nums.length <= 1000 0 <= nums[i] <= 106 1 <= m <= min(50, nums.length) Source: LeetCode Link:https://leetcode-cn.com/problems/split-array-largest-sum ...
Hello, does anybody know if I can modify KMP for a pattern string with '?' symbols, that match any single character, so that I can find whether a pattern P that may contain '?' is in a text T (without '?') in O(|T|) time? Cheers...
Given a 1-d array candy crush, return the shortest array after removing all the continuous same numbers (the no of occurences of repeating number >= 3) input: 1-d array [1, 3, 3, 3, 2, 2, 2, 3, 1] return: [1, 1] (Explanation:- 133322231->133331->11). ...
技术标签: leetcode 200 岛屿的数量 leetcode 206 反转链表200. Number of Islands 题目链接 题目解释:给出一个二维的数组,里面只是包含字符‘0’和字符‘1’,其中字符‘0’代表水,字符‘1’代表岛屿。岛屿是被水所环绕同时也是被垂直或者水平方向的岛屿相连接。假设所有边缘的部分都是被水所环绕 Example 1: ...