原创 394. Decode String(Leetcode每日一題-2020.05.28)

Problem Given an encoded string, return its decoded string. The encoding rule is: k[encoded_string], where the enco

原创 974. Subarray Sums Divisible by K(Leetcode每日一題-2020.05.27)

Problem Given an array A of integers, return the number of (contiguous, non-empty) subarrays that have a sum divisi

原创 198. House Robber(Leetcode每日一題-2020.05.29)

class Solution { public: int rob(vector<int>& nums) { //f[i]表示在前i個數中,所有不選nums[i]的最大值,f[i] = max(f[i-1],

原创 84. Largest Rectangle in Histogram(Leetcode每日一題-2020.05.30)

class Solution { public: int Max(int a, int b){return a > b ? a : b;} int largestRectangleArea(vector<int>

原创 面試題64. 求1+2+…+n(Leetcode每日一題-2020.06.02)

Problem 求 1+2+…+n ,要求不能使用乘除法、for、while、if、else、switch、case等關鍵字及條件判斷語句(A?B:C)。 Example1 輸入: n = 3 輸出: 6 Example2

原创 287. Find the Duplicate Number(Leetcode每日一題-2020.05.26)

Problem Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that

原创 1431. Kids With the Greatest Number of Candies(Leetcode每日一題-2020.06.01)

Problem Given the array candies and the integer extraCandies, where candies[i] represents the number of candies tha

原创 146. LRU Cache(Leetcode每日一題-2020.05.25)

Problem Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following

原创 76. Minimum Window Substring(Leetcode每日一題-2020.05.23)

Problem Given a string S and a string T, find the minimum window in S which will contain all the characters in T in

原创 4. Median of Two Sorted Arrays(Leetcode每日一題-2020.05.24)

Problem There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted

原创 5. Longest Palindromic Substring(Leetcode每日一題-2020.05.21)

Problem Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s

原创 1371. Find the Longest Substring Containing Vowels in Even Counts(Leetcode每日一題-2020.05.20)

Problem Given the string s, return the size of the longest substring containing each vowel an even number of times.

原创 680. Valid Palindrome II(Leetcode每日一題-2020.05.19)

Problem Given a non-empty string s, you may delete at most one character. Judge whether you can make it a palindrom

原创 152. Maximum Product Subarray(Leetcode每日一題-2020.05.18)

Problem Given an integer array nums, find the contiguous subarray within an array (containing at least one number)

原创 210. Course Schedule II(Leetcode每日一題-2020.05.17)

Problem There are a total of n courses you have to take, labeled from 0 to n-1. Some courses may have prerequisites