[Daily] 2021-06-16 WED

Physics

Quantum Information/Quantum Computation

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

    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