Tag：Problem solving

Onshore Algorithm I LeetCode Weekly Contest 230 Problem Solving Report
No.1 Count the number of items matching the search rule Problem solving ideas enumeration, statistics. Code display class Solution { public int countMatches(List<List<String>> items, String ruleKey, String ruleValue) { int index = 0; if (ruleKey.equals(“color”)) { index = 1; } else if (ruleKey.equals(“name”)) { index = 2; } int count = 0; for (var item […]

Leetcode PHP题解–D129 836. Rectangle Overlap
D129 836. Rectangle Overlap topic link 836. Rectangle Overlap topic analysis Given the coordinates of the lower left and upper right corners of the two rectangles, determine whether the rectangles overlap. Edges and corners that are the same do not overlap. Problem solving ideas Let's ignore the Y axis first and only consider the X […]

Innovate! JD T7 created a "New Algorithm Collection", with pictures and texts, a new interpretation, so cool
preface Algorithms are a science, but they are always neglected by some programmers. Today's developers are more keen on the practice of programming languages to meet the needs of interview requirements, so the learning of algorithms is slightly ignored. In fact, in recent years, the requirements of various Internet companies for algorithms have become higher […]

Disembarkation algorithm I leetcode weekly contest 217 problem solving Report
No.1 total assets of the richest customers Problem solving ideas Find the maximum value of the sum of subarrays You can use stream after Java 8 in one sentence Code presentation classSolution{ publicintmaximumWealth(int[][] accounts){ return Arrays.stream(accounts). map(i > Arrays.stream(i).sum()). max(Integer::compareTo).get(); } } No.2 find the most competitive subsequence Problem solving ideas That is to find […]

MySQL ranking problem
catalogue sketch The nth highest salary (ranking consecutively, with the same salary and the same name) Single table query Subquery method 1 Subquery method 2 Self connection Cartesian product Custom variables Windowing function Top n high salary of the Department (continuous ranking, with the same salary and the same name) Subquery method join query Custom […]

Disembarkation algorithm I leetcode weekly contest 218 problem solving Report
No.1 design goal parser Problem solving ideas See code notes below for details. Code presentation class Solution { public String interpret(String command) { command = command.replaceAll(“\\(\\)”, “o”); command = command.replaceAll(“\\(al\\)”, “al”); return command; } } No.2 maximum number of K and number pairs Problem solving ideas Use map to count the number of occurrences of […]

Disembarkation algorithm I leetcode weekly contest 219 problem solving Report
No.1 number of matches in the competition Problem solving ideas The simulation process is simple. Code presentation class Solution { public int numberOfMatches(int n) { int res = 0; while (n > 1) { res += n / 2; n = (n + 1) / 2; } return res; } } No.2 ten – minimum […]

poj3934Queue
Title Link:http://poj.org/problem?id=3934； Problem solving idea: we require n individuals and M pairs, so we need two states, I and j, to represent a total of I individuals. Among them, the number of methods for arranging J pairs. We need to find out which states determine a state (this is the key to solving the problem). […]

Disembarkation algorithm I leetcode weekly contest 222 problem solving Report
No.1 maximum number of units on the truck Problem solving ideas Priority should be given to the use of boxes with large capacity. Code presentation class Solution { public int maximumUnits(int[][] boxTypes, int truckSize) { Arrays.sort(boxTypes, (a, b) > (b[1] – a[1])); int res = 0; for (var box : boxTypes) { int cnt = […]

Disembarkation algorithm I leetcode weekly contest 224 problem solving Report
No.1 number of rectangles that can form the largest square Problem solving ideas Maintain the side length of the largest square and count it. Code display class Solution { public int countGoodRectangles(int[][] rectangles) { int maxLen = 0, count = 0; for (int[] rec : rectangles) { int len = Math.min(rec[0], rec[1]); if (len > […]

Leetcode PHP solution — d133 9 Palindrome Number
D133 9. Palindrome Number Title Link 9. Palindrome Number Topic analysis This question is very simple. It is to judge whether a given number is a palindrome number. The palindrome number is the same as reading from left to right. But this question is slightly different from question 7, and the symbols should be the […]

Docker start reports an error: container_ linux. go:380、error adding seccomp filter rule for syscall clone3
Problem Description: Error response from daemon: failed to create shim: OCI runtime create failed: container_linux.go:380: starting container process caused: error adding seccomp filter rule for syscall clone3: peron denied: unknown Problem background: NVIDIA Docker: 2.8.0 Client: Version: 20.10.7 API version: 1.41 Go version: go1.13.8 […]