ARTS-week43

Algorithms

First Unique Character in a String

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
class Solution {
public:
int firstUniqChar(string s) {
unordered_map<char, int> m;
for (int i = 0; i < s.size(); i++) {
m[s[i]]++;
}
for (int i = 0; i < s.size(); i++) {
if (m[s[i]] == 1) {
return i;
}
}
return -1;
}
};

Find the Difference

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
class Solution {
public:
char findTheDifference(string s, string t) {
unordered_map<char, int> m;
for (int i = 0; i < s.size(); i++) {
m[s[i]]++;
}

for (int i = 0; i < t.size(); i++) {
if ( --m[t[i]] < 0) {
return t[i];
}
}
return 0;
}
};

Review

本周阅读英文文章:
1、The REST Authenticators

2、The phenomena of targeted attacks

3、You May Be Able to Find Invisible Malware, But Getting Rid of It Isn’t Easy

Technique

本周学习了Cython的一些相关知识,笔记我有单独写出记录下来:
Cython学习笔记(一)
Cython学习笔记(二)
Cython学习笔记(三)

Share

分享一篇微步在线在freebuf上发的威胁情报的文章:
威胁情报的现在与未来:赋能、深入、全面应用

0%