LeetCode刷題Medium篇Palindrome Partitioning
題目
Given a string s, partition s such that every substring of the partition is a palindrome.
Return all possible palindrome partitioning of s.
Example:
Input: "aab" Output: [ ["aa","b"], ["a","a","b"] ]
十分鐘嘗試
相關推薦
LeetCode刷題Medium篇Palindrome Partitioning
題目 Given a string s, partition s such that every substring of the partition is a palindrome. Return all possible palindrome partiti
LeetCode刷題Medium篇Zigzag Conversion
題目 The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern i
LeetCode刷題Easy篇. Palindrome Linked List
題目 Given a singly linked list, determine if it is a palindrome. Example 1: Input: 1->2 Output: false Example 2: Input: 1->2->2->
LeetCode刷題Medium篇Permutations全排列----回溯法backtracking
題目 Given a collection of distinct integers, return all possible permutations. Example: Input: [1,2,3] Output: [ [1,2,3], [1,3,2],
LeetCode刷題Medium篇Top K Frequent Elements
題目 Given a non-empty array of integers, return the k most frequent elements. Example 1: Input: nums = [1,1,1,2,2,3], k = 2 Output: [1,
LeetCode刷題Medium篇Kth Smallest Element in a BST
題目 Given a binary search tree, write a function kthSmallest to find the kth smallest element in it. Note: You may assume k is
LeetCode刷題Medium篇Shuffle an Array
題目 Shuffle a set of numbers without duplicates. Example: // Init an array with set 1, 2, and 3. int[] nums = {1,2,3}; Solution solution = new So
LeetCode刷題Medium篇4SumII
題目 Given four lists A, B, C, D of integer values, compute how many tuples (i, j, k, l) there are such that A[i] + B[j] + C[k] + D[l]&
LeetCode刷題Medium篇 Subsets
題目 Given a set of distinct integers, nums, return all possible subsets (the power set). Note: The solution set must not contai
LeetCode刷題Medium篇Generate Parentheses
題目 Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For example, given n&nbs
LeetCode刷題Medium篇 Set Matrix Zeroes
題目 Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in-place. Example 1: Input: [ &
LeetCode刷題Medium篇Course Schedule
題目 There are a total of n courses you have to take, labeled from 0 to n-1. Some courses may have prerequisites, for examp
LeetCode刷題Medium篇Construct Binary Tree from Preorder and Inorder Traversal
題目 Given preorder and inorder traversal of a tree, construct the binary tree. Note: You may assume that duplicates do not exist in the tree. For
LeetCode刷題Medium篇Number of Islands
題目 Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrounded by water and is formed by con
LeetCode刷題Medium篇Increasing Triplet Subsequence
題目 Given an unsorted array return whether an increasing subsequence of length 3 exists or not in the array. Formally the function should: Ret
LeetCode刷題Medium篇Letter Combinations of a Phone Number
題目 Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. A mappi
LeetCode刷題Medium篇Binary Tree Zigzag Level Order Traversal
題目 Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the
LeetCode刷題Medium篇 Perfect Squares
題目 Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, ...) which sum to n. Exam
LeetCode刷題Medium篇Kth Smallest Element in a Sorted Matrix
題目 Given a n x n matrix where each of the rows and columns are sorted in ascending order, find the kth smallest element in the m
LeetCode刷題Medium篇Search a 2D Matrix II
題目 Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties: Int