原创 leetcode_[python/C++]_424_Longest Repeating Character Replacement

題目鏈接 【題目】 Given a string that consists of only uppercase English letters, you can replace any letter in the strin

原创 leetcode_[python/C++] 179. Largest Number(數字組合成最大數)

題目鏈接 【題目】 Given a list of non negative integers, arrange them such that they form the largest number. For example

原创 leetcode_[python/C++]_91_Decode Ways_動態規劃

題目鏈接 【題目】 A message containing letters from A-Z is being encoded to numbers using the following mapping: ‘A’ ->

原创 leetcode_[python/C++]_21. Merge Two Sorted Lists(合併有序鏈表)

題目鏈接 【題目】 Merge two sorted linked lists and return it as a new list. The new list should be made by splicing toge

原创 leetcode_[python/C++]_98_Validate Binary Search Tree

題目鏈接 【題目】 Given a binary tree, determine if it is a valid binary search tree (BST). Assume a BST is defined as fol

原创 數獨_約束求解_by C++ and Python

利用每一個空格的域空間進行約束求解,註釋應該夠了,直接貼代碼 C++: #include <iostream> #include <string> #include <algorithm> #include <vector> #i

原创 leetcode_[Python/C++]_3_Longest Substring Without Repeating Characters(不重複子串最大長度)

題目鏈接 【題意】 給定一個字符串,找到其中的一個最長的字串,使得這個子串不包含重複的字符 【分析】 題目很簡單,第一眼想到的是動態規劃,另外主要是爲了分享一些做法寫法 C++ class Solution { publ

原创 leetcode_[python/C++]_395_Longest Substring with At Least K Repeating Characters_(遞歸非遞歸)

題目鏈接 【題目】 Find the length of the longest substring T of a given string (consists of lowercase letters only) such t

原创 leetcode_[python/C++]_121/122/123/188.Best Time to Buy and Sell Stock I/II/III/IV

121. Best Time to Buy and Sell Stock [題目] Say you have an array for which the ith element is the price of a given

原创 leetcode_[python/C++] 17.Letter Combinations of a Phone Number(手機號碼字符組合)

題目鏈接 【題目】 Given a digit string, return all possible letter combinations that the number could represent. A mappin

原创 leetcode_[python/C++] 329. Longest Increasing Path in a Matrix(DFS+記憶化搜索)

題目鏈接 【題目】 Given an integer matrix, find the length of the longest increasing path. From each cell, you can either

原创 leetcode_[python/java/javascript/C++]_401_Binary Watch(二進制手錶)

題目鏈接 【題目】 A binary watch has 4 LEDs on the top which represent the hours (0-11), and the 6 LEDs on the bottom rep

原创 leetcode_[python/C++]_395_Longest Substring with At Least K Repeating Characters

題目鏈接 【題目】 Find the length of the longest substring T of a given string (consists of lowercase letters only) such that

原创 leetcode_326. Power of Three分析

類似的題解詳見: leetcode_232. Power of Two分析 leetcode_342. Power of Four分析 題目鏈接 【題目】 Given an integer, write a funct

原创 leetcode_[python/C++]_300_Longest Increasing Subsequence

題目鏈接 【題目】 Given an unsorted array of integers, find the length of longest increasing subsequence. For example Gi