随笔分类 -  Backtracing

摘要:太麻烦了只好用Backtracking public List<List<Integer>> fourSum(int[] nums, int target) { List<List<Integer>> ans = new ArrayList<List<Integer>>(); if(nums == 阅读全文
posted @ 2022-05-02 05:38 苗妙苗 阅读(29) 评论(0) 推荐(0)
摘要:You are given nums, an array of positive integers of size 2 * n. You must perform n operations on this array. In the ith operation (1-indexed), you wi 阅读全文
posted @ 2021-09-07 08:03 苗妙苗 阅读(66) 评论(0) 推荐(0)
摘要:Given a string s and a dictionary of strings wordDict, add spaces in s to construct a sentence where each word is a valid dictionary word. Return all 阅读全文
posted @ 2021-08-30 09:49 苗妙苗 阅读(41) 评论(0) 推荐(0)
摘要:Given two integers n and k, return all possible combinations of k numbers out of 1 ... n. You may return the answer in any order. Example 1: Input: n 阅读全文
posted @ 2021-02-27 14:16 苗妙苗 阅读(71) 评论(0) 推荐(0)
摘要:Given a string s, partition s such that every substring of the partition is a palindrome. Return all possible palindrome partitioning of s. Example: I 阅读全文
posted @ 2020-08-15 11:14 苗妙苗 阅读(101) 评论(0) 推荐(0)
摘要:Given a collection of candidate numbers (candidates) and a target number (target), find all unique combinations in candidates where the candidate numb 阅读全文
posted @ 2020-08-13 23:17 苗妙苗 阅读(158) 评论(0) 推荐(0)
摘要:Given an integer array, your task is to find all the different possible increasing subsequences of the given array, and the length of an increasing su 阅读全文
posted @ 2020-07-03 05:51 苗妙苗 阅读(138) 评论(0) 推荐(0)
摘要:Given a string s, partition s such that every substring of the partition is a palindrome. Return all possible palindrome partitioning of s. Example: I 阅读全文
posted @ 2020-07-01 23:28 苗妙苗 阅读(113) 评论(0) 推荐(0)
摘要:Given a collection of candidate numbers (candidates) and a target number (target), find all unique combinations in candidates where the candidate numb 阅读全文
posted @ 2020-07-01 08:11 苗妙苗 阅读(112) 评论(0) 推荐(0)
摘要:Given a collection of candidate numbers (candidates) and a target number (target), find all unique combinations in candidates where the candidate numb 阅读全文
posted @ 2020-07-01 05:37 苗妙苗 阅读(99) 评论(0) 推荐(0)
摘要:Given a set of candidate numbers (candidates) (without duplicates) and a target number (target), find all unique combinations in candidates where the 阅读全文
posted @ 2020-07-01 05:22 苗妙苗 阅读(155) 评论(0) 推荐(0)
摘要:Given a collection of numbers that might contain duplicates, return all possible unique permutations. Example: Input: [1,1,2] Output: [ [1,1,2], [1,2, 阅读全文
posted @ 2020-06-29 09:37 苗妙苗 阅读(157) 评论(0) 推荐(0)
摘要:Given a collection of integers that might contain duplicates, nums, return all possible subsets (the power set). Note: The solution set must not conta 阅读全文
posted @ 2020-06-28 23:44 苗妙苗 阅读(107) 评论(0) 推荐(0)
摘要:Given a set of distinct integers, nums, return all possible subsets (the power set). Note: The solution set must not contain duplicate subsets. Exampl 阅读全文
posted @ 2020-06-28 09:38 苗妙苗 阅读(164) 评论(0) 推荐(0)
摘要:Given a collection of numbers that might contain duplicates, return all possible unique permutations. Example: Input: [1,1,2] Output: [ [1,1,2], [1,2, 阅读全文
posted @ 2020-06-25 22:35 苗妙苗 阅读(120) 评论(0) 推荐(0)
摘要:[抄题]: Given a string S, we can transform every letter individually to be lowercase or uppercase to create another string. Return a list of all possibl 阅读全文
posted @ 2018-03-09 20:03 苗妙苗 阅读(810) 评论(0) 推荐(0)
摘要:[抄题]: A binary watch has 4 LEDs on the top which represent the hours (0-11), and the 6 LEDs on the bottom represent the minutes (0-59). Each LED repre 阅读全文
posted @ 2018-03-09 10:03 苗妙苗 阅读(211) 评论(0) 推荐(0)