原创 算法作業HW14:Leetcode20 Valid Parentheses

Description: Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input s

原创 算法設計與分析HW4:LeetCode5

Description: Given a string s, find the longest palindromic substring in s. You may assume that the maximum le

原创 算法設計與分析HW3:LeetCode3

Description:   Given a string, find the length of the longest substring without repeating characters. Note:   N

原创 算法設計與分析HW1:LeetCode7

Description: Reverse digits of an integer. Example 1: Input:123 Output:321 Example 2: Input:-123 Output:-321 Note:

原创 算法設計與分析HW2:LeetCode35

Description: Given a sorted array and a target value, return the index if the target is found. If not, return the ind

原创 算法作業HW9:LeetCode93 Restore IP Addresses

Description: Given a string containing only digits, restore it by returning all possible valid IP address combination

原创 算法作業HW12:Leetcode94 Sum Root to Leaf Numbers

Description: Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number.

原创 算法設計與分析 HW6:LeetCode 54

Description: Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral orde

原创 算法設計與分析HW5:LeetCode77

Description: Given two integers n and k, return all possible combinations of k numbers out of 1 ... n. Note:  

原创 算法作業HW11:Leetcode90 Path Sum

Description: Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all th

原创 算法作業HW15:LeetCode187 Repeated DNA Sequences

Description: All DNA is composed of a series of nucleotides abbreviated as A, C, G, and T, for example: "ACGAATTCCG

原创 算法設計與分析HW8:LeetCode71.Simplify Path

Description: Given an absolute path for a file (Unix-style), simplify it. Note: For example, path = "/home/",

原创 算法作業HW13:Leetcode96 Unique Binary Search Trees

Description: Given n, how many structurally unique BST’s (binary search trees) that store values 1…n? Note: For

原创 算法作業HW10:Leetcode92 Reverse Linked List II

Description: Reverse a linked list from position m to n. Do it in-place and in one-pass. Note: For example:Given

原创 算法設計與分析HW7:LeetCode56.Merge Intervals

Description:   Given a collection of intervals, merge all overlapping intervals.   For example, Given [1,3],[2,6]