*@linkhttps://leetcode-cn.com/problems/permutation-in-string/ *@solutions* *@best_solutions* */export{};constlog =console.log;// s1 和 s2 仅包含小写字母functioncheckInclusion(s1: string, s2: string): boolean {constlen1 = s1.length;constlen2 = s2.length;// 如果 s1 长度大于 s2, 直...
Find all the permutations of a string 就是permutations II考虑有重复字母的情况。 String str = "someString"; char[] charArray = str.toCharArray(); 对char array进行排序: Arrays.sort(charArray) 之后再把CharArray转化成string: char[] myString = new char[] {'T', 'H', 'I', 'S', ' ',...
('$' means the problem is locked on Leetcode, '*' means the problem is related to Database, '#' means the problem is related to Shell, '~' means the concurrency problems.) #TitleSolutionDifficulty 1352 Product of the Last K Numbers 50.20% Medium 1351 Count Negative Numbers in a Sorted...
806 写字符串需要的行数 - Number of Lines To Write String C++ Java Python3 Easy 805 数组的均值分割 - Split Array With Same Average C++ Java Python3 Hard 804 唯一摩尔斯密码词 - Unique Morse Code Words C++ Java Python3 Easy 803 打砖块 - Bricks Falling When Hit C++ Java Python3 Hard 802...
package leetcode func findSubstring(s string, words []string) []int { if len(words) == 0 { return []int{} } res := []int{} counter := map[string]int{} for _, w := range words { counter[w]++ } length, totalLen, tmpCounter := len(words[0]), len(words[0])*len(w...
4 Median of Two Sorted Arrays Hard 17.40% 5 Longest Palindromic Substring Medium 20.70% 6 ZigZag Conversion Easy 21.80% 7 Reverse Integer Easy 25.10% 8 String to Integer (atoi) Easy 13.00% 9 Palindrome Number Easy 28.30% 10 Regular Expression Matching Hard 20.70% 11 Container With Most Water...
终于将LeetCode的大部分题刷完了,真是漫长的第一遍啊,估计很多题都忘的差不多了,这次开个题目汇总贴,并附上每道题目的解题连接,方便之后查阅吧~ 博主还制作了一款 网页版APP,方便大家进行查阅,网址如下: https://grandyang.com 对应的 Github 项目 的同步地址如下,欢迎大家关注点赞 ️ https://github....
String Print all the permutations of the given string <-> String Split the Binary string into two substring with equal 0’s and 1’s <-> String Word Wrap Problem [VERY IMP]. <-> String EDIT Distance [Very Imp] <-> String Find next greater number with same set of digits. [Very Ver...
0046-permutations Time: 1 ms (95.51%), Space: 44.2 MB (74.96%) - LeetHub Apr 14, 2024 0049-group-anagrams Time: 9 ms (34.75%), Space: 48 MB (19.36%) - LeetHub Feb 7, 2024 0050-powx-n Time: 3 ms (40.07%), Space: 6.2 MB (7.02%) - LeetHub Sep 15, 2023 0057-insert-in...
903 Valid Permutations for DI Sequence 45.10% Hard 902 Numbers At Most N Given Digit Set 28.80% Hard 901 Online Stock Span 49.90% Medium 900 RLE Iterator 50.50% Medium 899 Orderly Queue 47.70% Hard 898 Bitwise ORs of Subarrays 34.70% Medium 897 Increasing Order Search Tree 65.20% Easy 896...