大道至简

人生苦短,我用Python.

LeetCode-746-Min Cost Climbing Stairs

LeetCode-746-Min Cost Climbing Stairs

1、题目 On a staircase, the i-th step has some non-negative cost cost[i] assigned (0 indexed). Once you pay the cost, you can either climb one or two steps. You need to find minimum cost to reach th...

LeetCode-Alg-1005-Maximize Sum Of Array After K Negations

LeetCode-Alg-1005-Maximize Sum Of Array After K Negations

1、题目 Given an array A of integers, we must modify the array in the following way: we choose an i and replace A[i] with -A[i], and we repeat this process K times in total. (We may choose the same ...

LeetCode-Alg-970-Powerful-Integers

LeetCode-Alg-970-Powerful-Integers

1、题目 Given two positive integers x and y, an integer is powerful if it is equal to x^i + y^j for some integers i >= 0 and j >= 0. Return a list of all powerful integers that have value less...

LeetCode-Alg-860-Lemonade-Change

LeetCode-Alg-860-Lemonade-Change

1、题目 At a lemonade stand, each lemonade costs $5. Customers are standing in a queue to buy from you, and order one at a time (in the order specified by bills). Each customer will only buy one le...

LeetCode-Alg-400-Nth-Digit

LeetCode-Alg-400-Nth-Digit

1、题目 Find the nth digit of the infinite integer sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, … Note: n is positive and will fit within the range of a 32-bit signed integer (n < 231). Example 1...

LeetCode-Alg-1025-Divisor Game

LeetCode-Alg-1025-Divisor Game

1、题目 Alice and Bob take turns playing a game, with Alice starting first. Initially, there is a number N on the chalkboard. On each player’s turn, that player makes a move consisting of: Choosin...

LeetCode-Alg-285-Add Digits

LeetCode-Alg-285-Add Digits

1、题目 Given a non-negative integer num, repeatedly add all its digits until the result has only one digit. Example: Input: 38 Output: 2 Explanation: The process is like: 3 + 8 = 11, 1 + 1 = 2. ...

LeetCode-Alg-171-Excel Sheet Column Number

LeetCode-Alg-171-Excel Sheet Column Number

1、题目 Given a column title as appear in an Excel sheet, return its corresponding column number. For example: A -> 1 B -> 2 C -> 3 ... Z -> 26 AA -> 27 AB -> 28 ... Example 1: I...

LeetCode-Alg-168-Excel Sheet Column Title

LeetCode-Alg-168-Excel Sheet Column Title

1、题目 Given a positive integer, return its corresponding column title as appear in an Excel sheet. For example: 1 -> A 2 -> B 3 -> C ... 26 -> Z 27 -> AA ...

LeetCode-Alg-784-Letter Case Permutation

LeetCode-Alg-784-Letter Case Permutation

1、题目 Given a string S, we can transform every letter individually to be lowercase or uppercase to create another string. Return a list of all possible strings we could create. Examples: Input: S...

< script src = " / js / bootstrap.min.js " >