Skip to content

Commit 177d681

Browse files
zhangzz2015gitbook-bot
authored andcommitted
GitBook: [greyireland#7] No subject
1 parent efdeb4a commit 177d681

File tree

4 files changed

+41
-1
lines changed

4 files changed

+41
-1
lines changed

SUMMARY.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,7 @@
2929

3030
## 面试公司
3131

32-
* [FaceBook](mian-shi-gong-si/facebook.md)
32+
* [Facebook](mian-shi-gong-si/facebook.md)
33+
* [Amazon](mian-shi-gong-si/amazon.md)
34+
* [Google](mian-shi-gong-si/google.md)
35+
* [Linkedin](mian-shi-gong-si/linkedin.md)

mian-shi-gong-si/amazon.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Amazon
2+
3+
### OA questions.
4+
5+
#### **Amazon OA password strength**
6+
7+
Given a string password, find the strength of that password. The strength of a password, consisting only lowercase english letters only, is calculated as the sum of the number of distinct characters present in all possible substrings of that password. Example:- password = "good" possible sub string and count of distinct characters are g = 1 o = 1 o = 1 d = 1 go = 2 oo = 1 od = 2 goo = 2 ood = 2 good = 3 1+1+1+1+2+1+2+2+2+3 = 16
8+
9+
```cpp
10+
// Some code
11+
// A 1
12+
// A B prev + (i -(-1)) = 3;
13+
// A B A
14+
int passwdStrengh(string s)
15+
{
16+
vector<int> pos(26,-1);
17+
int cur =0;
18+
int res =0;
19+
for(int i=0; i< s.size(); i++)
20+
{
21+
int index = s[i]-'a';
22+
cur += (i - pos[index]);
23+
res += cur;
24+
}
25+
return res;
26+
}
27+
```
28+
29+
#### **aaa**&#x20;
30+
31+
****
32+
33+
####

mian-shi-gong-si/google.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Google
2+

mian-shi-gong-si/linkedin.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Linkedin
2+

0 commit comments

Comments
 (0)