[Daily] 2021-06-16 WED
Physics
Quantum Information/Quantum Computation
- Book:
Quantum Computation and Quantum Information
- Lectures
- Quantum Computation and Quantum Information 2018 lecture (included Youtube lecture)
- Quantum Computation 2004 lecture (Umesh Vazirani)
- Papers
- MA Nielsen, I Chuang, Quantum Computation and Quantum Information
Quantum simulator
Game
Game Engine Programming
: I don’t know where to start…
iOS
- Movie Application (Price/watched/related platform…)
- Swift (Flutter?)
Backend
- Spring Boot & Vue.js(or React.js) Project: Copy other apps or use free API or Github
LeetCode
Today: String
- 1358. Number of Substrings Containing All Three Characters
- sliding window
-
Problems: TLE
- Brute-force solution: make the substring ⇨ check a, b, c ⇨ ans++
- Time Complexity:
O(N^2)
-
Solution
- Easy and Concise Solution:
O(N)
Time complexity
- Easy and Concise Solution:
for(int j=0; j<sSize; j++) {
cnt[s[j]-'a']++;
while(cnt[0] && cnt[1] && cnt[2]) {
cnt[s[i++]-'a']--;
}
ans += i;
}
Additional picks
- More Similar Sliding Window Problems (from easy and concise solution)
- Count Number of Nice Subarrays
- Replace the Substring for Balanced String
- Max Consecutive Ones III
- Binary Subarrays With Sum
- Subarrays with K Different Integers
- Fruit Into Baskets
- Shortest Subarray with Sum at Least K
- Minimum Size Subarray Sum