Tag:thinking

  • Go and PHP calculate the sum result based on two sets of numbers

    Time:2021-7-19

    Original link: go letcode, author: San Jin and his meow PHP code Add two numbers This isLeetCodeThe second question is very conventional. The main stem is as follows: Two non empty linked lists are given to represent two non negative integers. Among them, their respective digits are stored in reverse order, and each node can […]

  • 30 + program veterans’ Transformation Path — tools (WPS + PostgreSQL)

    Time:2021-7-16

    Recently, I plan to learn something about data analysis. In the figure below, although there are a lot of advertising elements, there are many techniques. It is said that programmers should have a little product thinking and be sensitive to data. After reading the introduction of some training institutions, there are many knowledge points involved, […]

  • Binary tree (2): Supplement

    Time:2021-7-15

    Symmetric binary tree Create a function to determine whether a binary tree is symmetric As shown in the figure, this is a symmetric binary tree Note that this is not a symmetric binary tree Idea: start from the root node, compare its left subtree and right subtree nodes, and then recurse successively. As long as […]

  • Codeforces Good Bye 2020 A-D

    Time:2021-7-6

    A – Bovine Dilemma Solution: think that the problem said is a triangle, and there is a certain point (0,1), so here only need to find two points can form a triangle, and these two points are on the X axis, so you can know (0,1) to X axis is high, X axis two points […]

  • Here comes the list! What are the techies in Dachang reading: meituan

    Time:2021-7-3

    Click the blue “programmer book list” to follow me Add a “star sign” to show you good articles and books every day! ​ Recommendation list of meituan technical team PrinciplesRay Dalio ​ The author, ray Dalio, was born in an ordinary middle-class family in the United States. He was fired at the age of 26 […]

  • Questions on leetcode database

    Time:2021-6-27

    1. Find duplicate email Own idea (wrong) SELECT a.Email FROM Person a,Person b WHERE a.Email = b.Email Results: all of them appeared in the tableSolution: calculate the number of times each email exists SELECT Email FROM Person GROUP BY Email HAVING COUNT(Email)>1 Solution 2: create a temporary table SELECT Email FROM( SELECT Email,COUNT(Email) as num FROM Person […]

  • High performance mysql (version 3)_ Website click counter

    Time:2021-6-16

    Website visits statistics, their own ideas:Whenever a user visits a page, the front-end initialization method automatically calls the back-end interface for access statistics. A counter table can be created separately. Using an independent table can help avoid query cache failure. udpate hit_counter set cnt=cnt+1 ; But when a large number of users visit the website […]

  • Leetcode-0101 symmetric binary tree

    Time:2021-6-8

    Title addresshttps://leetcode-cn.com/problems/symmetric-tree/ 1. Recursion As like as two peas, the two most identical trees are mirrored. The relationship between them is satisfiednode1.left == node2.rightAndnode1.right == node2.leftThe time complexity O (n) n is the number of nodes; The space complexity O (H) H is the maximum depth of binary tree class Solution { public boolean isSymmetric(TreeNode […]

  • leetcode 151. Reverse Words in a String

    Time:2021-6-4

    Title Requirements Given an input string, reverse the string word by word. For example, Given s = “the sky is blue”, return “blue is sky the”. Update (2015-02-12): For C programmers: Try to solve it in-place in O(1) space. click to show clarification. Clarification: What constitutes a word? A sequence of non-space characters constitutes a […]

  • Rain water

    Time:2021-5-30

    42. Rainwater thinking from typing import List import bisect class Solution: def trap(self, height: List[int]) -> int: def helper(height, reverse=False): index, ans, left_max_h_index, n, water = 0, 0, 0, len(height), 0 if reverse: height.reverse() height, n = height + [0], n + 1 for index, h in enumerate(height): if index == 0 or index == […]

  • On leetcode-680

    Time:2021-5-8

    Topic introduction leetcode680 thinking This problem belongs to a simple type, the idea is not very complex, the use of double pointers, one point to the head of the string, one point to the tail, if the elements of the two pointers are equal, then each move one step to the middle, if not, you […]

  • Simple mind map plug-in with super high appearance in the introductory course of gitbook

    Time:2021-5-1

    Gitbook plug-in for generating and exporting mind map in markdown homepage Github : https://snowdreams1006.github.io/gitbook-plugin-simple-mind-map/ GitLab: https://snowdreams1006.gitlab.io/gitbook-plugin-simple-mind-map/ Gitee : https://snowdreams1006.gitee.io/gitbook-plugin-simple-mind-map/ Screen capture {% simplemindmap %} simplemindmap config book.json plugins others simple-mind-map pluginsConfig others simple-mind-map type preset linkShape autoFit style custom file.md markdown type preset linkShape autoFit style txtmap json mindmup {% endsimplemindmap %} usage Step 1 […]