diff --git a/CS notes/pages/Leetcode Intersection-of-Two-Arrays-II.md b/CS notes/pages/Leetcode Intersection-of-Two-Arrays-II.md index a5c3b07..f19fe67 100644 --- a/CS notes/pages/Leetcode Intersection-of-Two-Arrays-II.md +++ b/CS notes/pages/Leetcode Intersection-of-Two-Arrays-II.md @@ -1,6 +1,7 @@ # Leetcode Intersection-of-Two-Arrays-II #### 2022-06-11 +##### First revision 2022-06-27 --- ##### Data structures: @@ -61,6 +62,9 @@ Given two integer arrays `nums1` and `nums2`, return _an array of their intersec For the original problem, I thought up an O(m + n) algo, that uses C++'s [[cpp_std_unordered_map]], and for the second one, I use double pointer method. +> [!tip] +> Because elements can be duplicated and we need to know how many, we should use unordered map to store the item's appereance times, (Maybe multiset can work too.) + > [!tip] Use [[cpp_std_unordered_map]] for a O(1) hash table when not sorted #tip > [!tip] Use [[cpp_std_sort]] to sort anything. #tip diff --git a/CS notes/pages/Leetcode Maximum-Difference-Between-Increasing-Elements.md b/CS notes/pages/Leetcode Maximum-Difference-Between-Increasing-Elements.md index 0a6fcf4..bdefe14 100644 --- a/CS notes/pages/Leetcode Maximum-Difference-Between-Increasing-Elements.md +++ b/CS notes/pages/Leetcode Maximum-Difference-Between-Increasing-Elements.md @@ -9,7 +9,7 @@ > ##### Additional tags: > #leetcode > ##### Revisions: -> Initial encounter: 2022-06-27 +> N/A ##### Related topics: ```expander diff --git a/_templates/OJ Problem Notes.md b/_templates/OJ Problem Notes.md index f4d513c..0e0ee79 100644 --- a/_templates/OJ Problem Notes.md +++ b/_templates/OJ Problem Notes.md @@ -11,8 +11,7 @@ > ##### Additional tags: > # # > ##### Revisions: -> Initial encounter: {{date}} -> 1st revision: +> N/A ##### Related topics: ```expander