Title Description
Please implement a function to find out the first character in the character stream. For example, when the first two characters “go” are read out from a character stream, the first character that appears only once is “g”. When the first six characters “Google” are read from the character stream, the first word appears only once.The symbol is “L”. If the current character stream does not exist once, it returns the character.
thinking
It’s similar to the character that only appears once in the preceding string, but not the...
Title Description
In an integer array, except for two numbers, all other numbers appear even numbers. Please write the program to find out the two numbers that appear only once.
thinking
Similar to the first occurrence of a unique character in that string, Baidu used count counting; in addition, Baidu found that it could also use the Counter method of the collection module to compose a dictionary of list values and corresponding numbers.
Method 1:
class Solution:
# Return to [a, b], where AB is the two number that appears at a time.
def FindNumsAppearOnce(self, array):
# w...
study from:
https://blog.csdn.net/A_Comme_Amour/article/details/79356220
1.
Edmonds-Karp No optimization
1 #include <cstdio>
2 #include <cstdlib>
3 #include <cmath>
4 #include <cstring>
5 #include <time.h>
6 #include <string>
7 #include <set>
8 #include <map>
9 #include <list>
10 #include <stack>
11 #include <queue>
12 #include <vector>
13 #include <bitset>
14 #include <ext/rope>
15 #include <algorithm>
16 #include <iostream>
17 using namespace std;
18 #define ll...
1. Explanation
You have to ask me what items I have audited and find any loopholes. I remember the boss of the first company asked me, “can you read the code?” I don’t know how to answer it. To understand that I’m not sure what the definition of code auditing is; to understand that I understand ECSHOP and the company’s code framework,I don’t think there is any difference between understanding code and source code auditing. Now, to tell you the difference, I think code auditing is a subset of “code understanding” just as penetration testing is a ...
Reprinted in: https://blog.csdn.net/2000killer/article/details/51228625
Preface
With the development of the company’s business, background business has become more and more, but the server failure like menstruation, from time to time turbulent, let us be defensive. Then the high availability of the background and the processing capacity of the server need to do a lateral expansion of the scheme, so as to make the background business sustainable and stable usability.Calm the hearts of the people.
Because our back-end business is all. net applications, plus the unanimous recommendation of...
Indexes
Notes
strict mode
jstype
jstest
Debugging
Exceptions
finally
Anomalous branch
Excercise
Retry
The locked box
Notes
1、strict mode
strict modeAdvantages: more stringent checks and deletion of some problematic language features.
Put “use strict” at the top of the file (it must be at the top of the file and be treated as a string elsewhere) or open JS string mode at the top of the function.
Example 1: if strict mode is not enabled, JS will add a let to you silently.
function canYouSpotTheProblem() {
"use strict";
for (counter = 0; counter < 10; counter+...
1. Strcpy and strncpy functions of strings
1、Programming to achieve strcpy function (written test is easy to test)
Request:
Prototype: char *stpcpy (char *strDest, char *strSrc);
Header file: #include < string.h>
Function: copy the string that SRC refers to by NULL to the array referred to by dest.
Note: Memory areas referred to by Src and dest cannot overlap and dest must have enough space to accommodate the SRC string.
Returns a pointer to the character (NULL) at the end of dest.
...