• ## [leetcode] 64. Conditional sum, recursion + Shift

Time：2021-6-15

To find 1 + 2 +… + N, it is required that keywords such as multiplication and division, for, while, if, else, switch, case, and conditional judgment statements (a? B: C) cannot be used. Example 1: Input: n = 3 Output: 6 Example 2: Input: n = 9 Output: 45 Restrictions:1 <= n <= 10000 […]

• ## Operators of go language foundation

Time：2021-5-8

Operators are used to perform mathematical or logical operations while a program is running. operator The built-in operators of go language are: Arithmetic operator Relational operators Logical operators Bitwise Operators Assignment Operators Arithmetic operator operator describe + Add – subtract * Multiply / be divided by % Surplus be careful: ++(self increasing) and–(self subtraction) is […]

• ## Delicious chocolate

Time：2021-3-19

Title Description The supermarket is selling chocolates at a special price, and lucky is being greedy_ Dog saw it.Chocolate from left to right in a row, a total of N, m kinds.There is a strange rule in the supermarket, that is, when you buy chocolate, you must provide two numbers a and B, representing that […]

• ## PHP | operator

Time：2021-2-7

concept Bit operators allow evaluation and manipulation of the bits specified in an integer number. command Example variable \$a = 1; / / 8-bit binary 0000 0001 \$B = 3; / / 8-bit binary 0000 0011 Command symbol name example effect result Binary & And (bitwise AND) \$a & \$b If the bits in \$a […]

• ## Look at animation algorithm: sort insert sort

Time：2021-1-28

brief introduction Insert sort is to insert the elements to be sorted into the sorted array to form a new ordered array. This algorithm is called insert sort. Insert sort example Similarly, if we have an array: 29, 10, 14, 37, 20, 25, 44, 15, how can we insert and sort it? Let’s first look […]

• ## Reading notes of “in depth understanding of computer system” — Chapter 2 information representation and processing

Time：2021-1-18

This chapter mainly studies the coding methods of unsigned numbers, complements and floating-point numbers in the computer. By studying the actual coding methods of numbers, we can understand the range of values that can be represented by different types of data in the computer, the properties of different arithmetic operations, and know how the computer […]