IrisJavaDiary

Wednesday, August 24, 2022

326. Power of Three

›
 一刷 08/2022 Version #1 Divide by 3 Time O(logN) Space O(1) Runtime:  23 ms , faster than  54.61%  of Java online submissions for Power of Th...
Monday, August 22, 2022

342. Power of Four

›
 一刷 08/2022 Version #1 Divide by 4 Time O(logN) Space O(1) Runtime:  1 ms , faster than  100.00%  of Java online submissions for Power of Fo...
Wednesday, August 17, 2022

1338. Reduce Array Size to The Half

›
 一刷 08/2022 Version #1 HashMap + sorting Time - N is array length, create the hash map O(N), sort the count worst case O(NlogN) - total O(Nl...

30. Substring with Concatenation of All Words

›
 一刷 08/2022 Version #1 Sliding Window 感觉这个的重点是sliding window invalid的时候不skip而是一个一个地挪left Time - word length W, word count N, string length L...

1570. Dot Product of Two Sparse Vectors

›
 一刷 08/2022 Version #1 Two Pointers Time O(N) - construction, O(N) - calculate product Space O(N) Runtime:  18 ms , faster than   25.58%   o...
Saturday, August 6, 2022

1220. Count Vowels Permutation

›
 一刷 08/2022 Version #1 1D DP Time O(N) Space O(1) Runtime:  9 ms , faster than  98.38%  of Java online submissions for Count Vowels Permutat...
Thursday, August 4, 2022

484. Find Permutation

›
 一刷 08/2022 Version #1 Stack 因为要保证最小,所以要reverse some subarray in the min array if we encountered a 'D' 因为在min array里面前面的element 永远是小...
›
Home
View web version

About Me

Iris's Blog
View my complete profile
Powered by Blogger.