HDU6831 : Fragrant numbers
[difficulty]
3.5/103.5/103.5/10
In fact, the very simple interval dp
But I didn't have time to think about it at that time//
[title]
Let SSS be an infinite string "1145141919" spliced together to become "114514191911451419114514191919..." "11451419114514191145141919 \ cdots" "1145141 ...

Leaf
Leaf is a distributed ID generation service launched by meituan. Its name is taken from the words of German philosopher and mathematician Leibniz: "there are no two identity leaves in the world." ("there are no two same leaves in the world"), taking a name has such moral meaning, meituan programmer Niu break!
Advantag ...

Posted by Chris_Evans on Wed, 25 May 2022 07:06:18 +0300

Establishment and traversal of binary tree (1) Establishment of binary tree Establish a binary tree by traversing in the first order and in the second order: In the pre order traversal sequence of binary tree, the first element is always the value of the root node of the tree. In the middle order traversal sequence, the value of the node of the ...

Posted by Brandon_R on Wed, 25 May 2022 06:18:05 +0300

strrev
The easiest solution!
s.reverse();
Of course, you can write it yourself!
let len = s.len();
let mut t: char;
for i in 0..len / 2 {
t = s[i];
s[i] = s[len - i - 1];
s[len - i - 1] = t;
}
Integer inversion, if leet writes STD before I32 e.g. std::i32::MAX, official recommendation direct I32
if x > i32::MAX - 1 || x < i ...

Posted by FoTo50 on Wed, 25 May 2022 04:51:23 +0300

The first question of LeetCode brushing questions, the use of the sum of two numbers and the hash table
Topic description
Given an integer array nums and a target value target, please find the two integers in the array whose sum is the target value, and return their array indices.
You can assume that there will only be one answer for each input ...

Posted by 8ta8ta on Tue, 24 May 2022 17:54:50 +0300

1, Topic analysis
(1) The problem can be abstracted as detecting whether a directed graph has a ring. If yes, return False; If not, return True.
(2) For a directed graph, we can delete nodes with zero penetration one by one. For each deleted node, the connected directed line segment will also be deleted (i.e. the penetration of this point as ...

Posted by judgy on Tue, 24 May 2022 11:48:30 +0300

Leetcode79 medium\color{#FF4500}{medium}medium
Click to enter the original question link: Word Search
Related topics: word search II word search II
[tag] backtracking search, C++ ASCII
subject
Discription
Given a 2D board and a word, find if the word exists in the grid.
The word can be constructed from letters of sequentially adjacent cell ...

Posted by snaack on Tue, 24 May 2022 01:57:25 +0300

Encryption algorithms can be divided into reversible encryption and irreversible encryption, and reversible encryption can be divided into symmetric encryption and asymmetric encryption.
1, Irreversible encryption
Common irreversible encryption algorithms include MD5, HMAC, SHA1, SHA-224, SHA-256, SHA-384, and SHA-512. Among them, SHA-224, SHA- ...

Posted by Fearless_Fish on Tue, 24 May 2022 01:49:38 +0300

Non subject class Xiaobai, record the learning process
The first reaction to this question is dfs, which is easy to record the number of layers, but dfs has defects. See details for details
"Why not use DFS" https://blog.csdn.net/sharemon/article/details/102857989 .
Such as data (1)
8 8
1 3
1 2
2 3
3 4
4 5
5 6
6 7
7 8
...

Posted by aaronlzw_21 on Tue, 24 May 2022 01:28:07 +0300

Decrypt QQ number - queue
The new semester begins. Xiaoha is xiaohum's new deskmate (xiaoha is a little beauty). Xiaohum asks xiaoha about the QQ number. Of course, xiaoha won't tell xiaohum directly. You know the reason. So xiaoha gave xiaohum a string of encrypted numbers, and xiaoha also told xiaohum the decryption rules. The rule is as f ...

Posted by srikanthiv on Mon, 23 May 2022 14:04:57 +0300