C++ sliding window頻率計數陣列解Leetcode難題76 Minimum Window Substring打敗100趴
難題Leetcode 76. Minimum Window Substring半年前就解出來了,不過解法不好,保持主要sliding window的架構,把unordered_map換成C int array,用點bitmask 就64個元素的陣列,先用C++,再用python於是100趴的code就成形了
===
The problem Leetcode 76. Minimum Window Substring was solved half a year ago, but the solution is not good. Keep the structure of sliding window, replace the unordered_map with C int array, use bitmask to create arrays of 64 elements, first use C++, and then use python, so the 100% code is made.
[codes on Leetcode]https://leetcode.com/problems/minimum-window-substring/solutions/4673600/sliding-windows-hash-tables-freq-array-0ms-beats-100/
[Leetcode playList]https://www.youtube.com/watch?v=KHVXYo7LxZE&list=PLYRlUBnWnd5IdDHk2BjqXwesydU17z_xk
[Dynamic Programming Playlist]https://www.youtube.com/watch?v=30yq3fmE6E8&list=PLYRlUBnWnd5K_XYUesV9oc6M9ONXII61T
沒有留言:
張貼留言