python flask-restful web backend

2020-05-24
阅读 12 分钟
4.9k
Table of Contents 1. Require 2. Run 2.1 Docker(Recommend) 2.2 Shell 2.3 Load Sample Data 3. REST 4. Benefits of Rest 5. Unified Response Structure 6. Unified Exception Handling 7. Unified Query Model, Response Model and DataBaseModel 7.1 This Project Use Query Model for Request arguments 7.2 This...

LeetCode 430. Flatten a Multilevel Doubly Linked List

2019-12-29
阅读 3 分钟
1.4k
You are given a doubly linked list which in addition to the next and previous pointers, it could have a child pointer, which may or may not point to a separate doubly linked list. These child lists may have one or more children of their own, and so on, to produce a multilevel data structure, as s...

LeetCode 429. N-ary Tree Level Order Traversal

2019-12-28
阅读 2 分钟
1.2k
Given an n-ary tree, return the level order traversal of its nodes' values.

LeetCode 424. Longest Repeating Character Replacement

2019-11-30
阅读 3 分钟
1.6k
Given a string s that consists of only uppercase English letters, you can perform at most k operations on that string.

LeetCode 423. Reconstruct Original Digits from English

2019-11-30
阅读 2 分钟
959
Given a non-empty string containing an out-of-order English representation of digits 0-9, output the digits in ascending order.

LeetCode 419. Battleships in a Board

2019-11-16
阅读 3 分钟
1.1k
Given an 2D board, count how many battleships are in it. The battleships are represented with 'X's, empty slots are represented with '.'s. You may assume the following rules:You receive a valid board, made of only battleships or empty slots.Battleships can only be placed horizontally or verticall...

LeetCode 417. Pacific Atlantic Water Flow

2019-11-02
阅读 3 分钟
1.3k
Given an m x n matrix of non-negative integers representing the height of each unit cell in a continent, the "Pacific ocean" touches the left and top edges of the matrix and the "Atlantic ocean" touches the right and bottom edges.

LeetCode 416. Partition Equal Subset Sum

2019-10-26
阅读 3 分钟
1.2k
Given a non-empty array containing only positive integers, find if the array can be partitioned into two subsets such that the sum of elements in both subsets is equal.

LeetCode 415. Add Strings

2019-10-14
阅读 1 分钟
1.1k
Given two non-negative integers num1 and num2 represented as string, return the sum of num1 and num2.

LeetCode 414. Third Maximum Number

2019-10-13
阅读 2 分钟
1.4k
Given a non-empty array of integers, return the third maximum number in this array. If it does not exist, return the maximum number. The time complexity must be in O(n).

LeetCode 413. Arithmetic Slices

2019-10-13
阅读 2 分钟
1.1k
A sequence of number is called arithmetic if it consists of at least three elements and if the difference between any two consecutive elements is the same.

LeetCode 410. Split Array Largest Sum

2019-10-05
阅读 3 分钟
1.2k
Given an array which consists of non-negative integers and an integer m, you can split the array into m non-empty continuous subarrays. Write an algorithm to minimize the largest sum among these m subarrays.

LeetCode 405. Convert a Number to Hexadecimal

2019-09-14
阅读 2 分钟
1.1k
Given an integer, write an algorithm to convert it to hexadecimal. For negative integer, two’s complement method is used.

LeetCode 404. Sum of Left Leaves

2019-09-14
阅读 1 分钟
1.2k
There are two left leaves in the binary tree, with values 9 and 15 respectively. Return 24.

LeetCode 403. Frog Jump

2019-09-08
阅读 3 分钟
1.6k
A frog is crossing a river. The river is divided into x units and at each unit there may or may not exist a stone. The frog can jump on a stone, but it must not jump into the water.

LeetCode 402. Remove K Digits

2019-09-07
阅读 2 分钟
1.1k
Given a non-negative integer num represented as a string, remove k digits from the number so that the new number is the smallest possible.

LeetCode 401. Binary Watch

2019-09-05
阅读 2 分钟
1.1k
A binary watch has 4 LEDs on the top which represent the hours (0-11), and the 6 LEDs on the bottom represent the minutes (0-59).

LeetCode 400. Nth Digit

2019-09-02
阅读 2 分钟
1.4k
Find the nth digit of the infinite integer sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, ...

LeetCode 398. Random Pick Index

2019-08-31
阅读 2 分钟
1k
Given an array of integers with possible duplicates, randomly output the index of a given target number. You can assume that the given target number must exist in the array.

LeetCode 397. Integer Replacement

2019-08-29
阅读 2 分钟
914
If n is even, replace n with n/2.If n is odd, you can replace n with either n + 1 or n - 1.What is the minimum number of replacements needed for n to become 1?

LeetCode 395. Longest Substring with At Least K

2019-08-28
阅读 2 分钟
1.5k
Find the length of the longest substring T of a given string (consists of lowercase letters only) such that every character in T appears no less than k times.

LeetCode 394. Decode String

2019-08-25
阅读 2 分钟
1.3k
The encoding rule is: k[encoded_string], where the encoded_string inside the square brackets is being repeated exactly k times. Note that k is guaranteed to be a positive integer.

LeetCode 393. UTF-8 Validation

2019-08-24
阅读 4 分钟
1.1k
A character in UTF8 can be from 1 to 4 bytes long, subjected to the following rules:

LeetCode 39. Combination Sum

2019-08-18
阅读 2 分钟
1.2k
Given a set of candidate numbers (candidates) (without duplicates) and a target number (target), find all unique combinations in candidates where the candidate numbers sums to target.

LeetCode 350. Intersection of Two Arrays II

2019-04-09
阅读 2 分钟
994
Description Given two arrays, write a function to compute their intersection. Example 1: Input: nums1 = [1,2,2,1], nums2 = [2,2]Output: [2,2]Example 2: Input: nums1 = [4,9,5], nums2 = [9,4,9,8,4]Output: [4,9]Note: Each element in the result should appear as many times as it shows in both arrays.T...

LeetCode 349. Intersection of Two Arrays

2019-04-09
阅读 1 分钟
1.1k
Description Given two arrays, write a function to compute their intersection. Example 1: Input: nums1 = [1,2,2,1], nums2 = [2,2]Output: [2]Example 2: Input: nums1 = [4,9,5], nums2 = [9,4,9,8,4]Output: [9,4]Note: Each element in the result must be unique.The result can be in any order. 描述 给定两...

LeetCode 347. Top K Frequent Elements

2019-04-09
阅读 2 分钟
1.3k
Given a non-empty array of integers, return the k most frequent elements.

LeetCode 345. Reverse Vowels of a String

2019-04-08
阅读 1 分钟
1.2k
Write a function that takes a string as input and reverse only the vowels of a string.

LeetCode 344. Reverse String

2019-04-08
阅读 2 分钟
1.4k
Write a function that reverses a string. The input string is given as an array of characters char[].

LeetCode 343. Integer Break

2019-04-08
阅读 2 分钟
1.2k
Given a positive integer n, break it into the sum of at least two positive integers and maximize the product of those integers. Return the maximum product you can get.