key - value mapping
{
"name": "Bob"
"age": 28,
"sex": "male"
}
// 20210306225038 | |
// https://duibiao-1298595392.ap-east-1.elb.amazonaws.com/api/threads/?category=6 | |
{ | |
"results": [ | |
{ | |
"id": 66, | |
"category": 6, | |
"title": "How to create a time_point object with year month day?", | |
"replies": 0, |
/* | |
s = "applepenapple" dictionary = ["apple", "pen"] | |
s = "apple" + "pen" + "apple" | |
return True | |
s = "appplepearapple" dictionary = ["apple", "pen"] | |
return False |
// | |
//Given two sequences pushed and popped with distinct values, | |
//return true if and only if this could have been the result of a sequence of push and pop operations on an initially empty stack. | |
//Example 1: | |
//Input: pushed = [1,2,3,4,5], popped = [4,5,3,2,1] | |
//Output: true | |
//Explanation: We might do the following sequence: |
// Print Immutable Linked List in Reverse | |
// immutable linked list, print out all values of each node in reverse | |
// APIs: | |
// ImmutableListNode: An interface of immutable linked list, you are given the head of the list. | |
// You need to use the following functions to access the linked list (you can't access the ImmutableListNode directly): | |
// ImmutableListNode.printValue(): Print value of the current node. | |
// ImmutableListNode.getNext(): Return the next node. | |
# getNext() -> ImmutableListNode or None |
# Definition for a binary tree node. | |
# class TreeNode: | |
# def __init__(self, x): | |
# self.val = x | |
# self.left = None | |
# self.right = None | |
class Solution: | |
def getTargetCopy(self, original: TreeNode, cloned: TreeNode, target: TreeNode) -> TreeNode: | |
val = target.val |
class Solution: | |
def largestRectangleArea(self, heights: List[int]) -> int: | |
stack = [-1] | |
result = 0 | |
heights.append(0) | |
for i in range(len(heights)): | |
while stack and heights[stack[-1]] > heights[i]: | |
h = heights[stack.pop()] | |
w = i - stack[-1] - 1 |
class Solution: | |
def gameOfLife(self, board: List[List[int]]) -> None: | |
""" | |
Do not return anything, modify board in-place instead. | |
""" | |
m = len(board) | |
if m == 0: | |
return | |
n = len(board[0]) |
from fastapi import FastAPI | |
import uuid | |
app = FastAPI() | |
COM_API_OBJECT = {} | |
@app.get("/create") | |
async def create(): |
DO $$ DECLARE | |
r RECORD; | |
BEGIN | |
FOR r IN (SELECT tablename FROM pg_tables WHERE schemaname = current_schema()) LOOP | |
EXECUTE 'DROP TABLE ' || quote_ident(r.tablename) || ' CASCADE'; | |
END LOOP; | |
END $$; |
key - value mapping
{
"name": "Bob"
"age": 28,
"sex": "male"
}