Finding the longest common subsequence in C++/python

C + + finding the longest common subsequence 1. Transverse scanning   2. Longitudinal scanning Problem solving ideas If there is no string, an empty string is returned; If there is only one string, return itself. Otherwise, take strs[0] as the standard and compare the remaining strings one by one for each character. If it is found that the ...

Posted by islan on Sun, 30 Jan 2022 06:44:11 +0100

[advanced learning notes of C language] III. detailed explanation of string function + memory function

This article continues from the previous article [advanced learning notes of C language] III. detailed explanation of string function (1) (sorting out liver explosion and hematemesis, recommended collection!!!) To introduce and learn the string operation function and memory operation function in detail. 9, strtok char* strtok(char ...

Posted by christa on Sat, 29 Jan 2022 15:03:59 +0100

Analysis of leetcode problem solving ideas 693 - 699 questions

Alternate bit binary number Given a positive integer, check whether its binary representation always alternates 0 and 1: in other words, the numbers of adjacent two digits in the binary representation will never be the same. Get data by bit and XOR class Solution { public: bool hasAlternatingBits(int n) { int a = n & 1; ...

Posted by a1amattyj on Fri, 28 Jan 2022 07:21:04 +0100

Redis is more than just get set. Analysis of eight data types and application scenarios

introduce How many data types does Redis have? (note that the data type is not a data structure) There are eight types in total: String, Hash, Set, List, Zset, Hyperloglog, Geo and Streams. 1. Why put data in memory? Faster memory, 10W QPSReduce computing time and reduce database pressure 2. If the data structure in memory is used as the c ...

Posted by gfX on Wed, 26 Jan 2022 16:49:42 +0100

Algorithm -- LeetCode 468 Verify IP address

1. Title Original question link Write a function to verify whether the input string is a valid IPv4 or IPv6 address. If it is a valid IPv4 address, return "IPv4"; If it is a valid IPv6 address, return "IPv6"; "Neither" is returned if the IP address is not of the above type. IPv4 addresses are represented by dec ...

Posted by Shuriken1 on Mon, 24 Jan 2022 20:10:41 +0100

Java development utility class

There are many tool libraries that can greatly simplify the amount of code and improve development efficiency, but many developers don't know. These class libraries have long become the industry standard class libraries, and are also used in large companies. 1. Java's own tools and methods 1.1 the list set is spliced into comma separated ...

Posted by garty on Mon, 24 Jan 2022 01:03:51 +0100

Codeforces Round #767 (Div. 2) (Updated)

title : Codeforces Round #767 (Div. 2) date : 2022-1-23 Tags: ACM, practice notes author : Linno Title link: https://codeforces.com/contest/1629 Test progress: 4/7 A-Download More RAM Give you the initial memory capacity k and n expansion packs. If your current memory is larger than the expansion pack's requirement ai, you can increase th ...

Posted by bidntrade on Sun, 23 Jan 2022 03:08:18 +0100

[skill summary] conversion between java integers, strings and arrays

Summarizes the common transformation methods between integers, strings and arrays in JAVA, as well as some common usages, which are convenient for reference and review. If you have any questions, you are welcome to leave a message. 1. Integer to string int number = 123456; Integer.toString(number); int number = 123456; String.valueOf(numb ...

Posted by blindeddie on Fri, 21 Jan 2022 05:45:41 +0100

Introduction to C + + Step03 [string and pointer]

Common string handling functions: String concatenation function: (strcat) char * strcat (char destination[], const char source[]); //Function: connect the string of parameter 2 to the end of the first parameter string //Return value: the first address of the first string //Note: ensure that the space length of parameter 1 is enough to store t ...

Posted by jannoy on Thu, 20 Jan 2022 06:31:06 +0100

[explain Java interview questions with pictures and text] - String, StringBuilder, StringBuffer, Exception, Error

Differences among String, StringBuilder and StringBuffer Know what it is and why. We want to answer the basic characteristics of String. String String is Java A class under Lang packageModified by the final keyword and cannot be inheritedThe internal data structure of JDK8 is char[] value modified by final, and JDK9 is Byte[] value array ...

Posted by jemgames on Tue, 18 Jan 2022 09:46:56 +0100