freqArray(): IntArray { val result = IntArray(26) this.forEach { result[it - 'a']++ } return result } } 分类: LeetCode/力扣题解 0 0 « 上一篇: [LeetCode] 416. Partition Equal Subset Sum(划分和相等的子集) » 下一篇: [
438. Find All Anagrams in a String # 题目 # Given a string s and a non-empty string p, find all the start indices of p’s anagrams in s. Strings consists of lowercase English letters only and the length of both strings s and p will not be larger than 2
refer to https://discuss.leetcode.com/topic/64434/shortest-concise-java-o-n-sliding-window-solution/2 1publicclassSolution {2publicList<Integer>findAnagrams(String s, String p) {3List<Integer> list =newArrayList<>();4if(s ==null|| s.length() == 0 || p ==null|| p.length() == ...
Findnon-overlap jobs withmaxcost Given a set of n jobs with [start time, end time, cost]finda subset so that no 2 jobs overlap and the cost is maximum.Job: (start_time, end_time] ... geeksforgeeks java 二维 leetcode 数据