Tag：Odd number

Time：20211018
In traditional Java programming, a wellknown knowledge point is:Private method cannot be defined in java interface interface。 Only methods, abstract methods or static methods that allow us to define public access rights are allowed. However, starting with Java 9, private methods and private static methods are allowed to be defined in the interface interface. Now […]

Time：20211010
preface Recently, we are implementing two requirements. Since there is no dependency between them, we want to use queue to decouple them; But inGoThere is no readily available and concurrent secure data structure in the standard library of; butGoProvides a more elegant solution, that ischannel。 Channel application GoAndJavaOne big difference is that the concurrency model […]

Time：2021103
Project scenario: Project scenario: a node X and Y in the echarts diagram are fixed,To center the same column, which stipulates:The current column has an odd number of elements, and the new nodes are put down. When there are even numbers of nodes, the new nodes are put up。 Problem Description: If you delete an […]

Time：2021916
Start the leetcode series of dynamic programming. Self supplement related to theoretical knowledge points, old rules, or start with simple topics. Leetcode70 This is an entrylevel topic. Find the total number of methods for N steps. When you reach the last step n, there are only two situations, one is from n1 (one step) and […]

Time：2021831
import random Ou = “even”Ji = “odd”a = range(1,11) x = 0 while x < 10: list = random.sample(a,10) print(list) if list[0] % 2 != 0: print(ji, end=”,”) else: print(ou, end=”,”) if list[1] % 2 != 0: print(ji, end=”,”) else: print(ou, end=”,”) if list[2] % 2 != 0: print(ji, end=”,”) else: print(ou, end=”,”) if list[3] […]

Time：2021817
package main import ( “fmt” ) func main() { var s1 []int = []int{1,2,3,4,5,6} var s2 []int = []int{1,2} rotate(s1) rotate(s2) fmt.Println(s1) fmt.Println(s2) } func rotate(s []int){ left,rigth := 0,0 If len (s)% 2 = = 0{// judge whether the length is odd or even, and determine the center of rotation according to this left […]

Time：202172
Topic 1: Calculation by Formula 1 π It is required to accumulate until the last term is less than 10 ^ ( 6). Program code: #include #include #include int main(){ float s=1; float pi=0; float i=1.0; float n=1.0; while(fabs(i)>=1e6){ pi+=i; n=n+2; //The design here is very clever. The sign is different every time s=s; i=s/n; […]

Time：2021624
Portal: https://leetcodecn.com/probl… First, estimate the violent solution: loop through each subarray to determine whether it is a graceful subarray, and the odd number of the array needs to be obtained in the judgment process. It is not advisable to estimate o (N3).dynamic programmingFor this problem, we can decompose the problem and use the results of […]

Time：2021411
Sub database and sub table Why do we have to divide the database and table? The amount of data in the database is uncontrollable. With the development of time and business, there are more and more data in the table. If you curd the database table again, it will cause performance problems. In order to […]

Time：2021326
Find out all the scores above 60 let scores = [95,91,59,55,42,82,72,85,67,66,55,91] let scores2 = scores.filter(item => item>60 ?) console.log(scores2) // [95,91,82,72,85,67,66, 91] Turn numbers into weeks let arr = [0,1,2,2,3,3,3,4,4,4,4,6] let arr2 = arr.map((item) =>{ return{ 0: ‘Monday’, 1: ‘Monday’, 2: ‘Tuesday’, 3: ‘Wednesday’, 4: ‘Thursday’, 6: ‘Saturday’ }[item] }) console.log (arr2) // [‘sunday ‘,’ […]

Time：2021322
Modification record: 2021.2.6 The format of the problem is unified 2021.2.3 At the end of the article, we add the recursive review link of big brother Ah, what is recursion? Namely: fromKnownreachunknown。Using observation to find the previous known data, we can get the conclusionRecurrence formulaAnd then the recursive formula is used to solve the problem. […]

Time：2021220
Title:An integer, after adding 100, is a complete square number, and then 168 is a complete square number. What is the number? Program analysis: Suppose the number is X. 1. Then: x + 100 = N2, x + 100 + 168 = m2 2. Calculation equation: M2 – N2 = (M + n) (M – […]