摘要:
I think the following code is self-explanatory enough. We use anunordered_map countsto record the expected times of each word and anotherunordered_map... 阅读全文
摘要:
By far the best solution I have seen is of O(n) time (some solutions claim to be of O(logn)turns out to be O(n)). One of the simplest ideas is to comp... 阅读全文
摘要:
Well, since theheadpointer may also be modified, we create anew_headthat points to it to facilitate the reverse process.For the example list1 -> 2 -> ... 阅读全文
摘要:
Well, since theheadpointer may also be modified, we create anew_headthat points to it to facilitate the reverse process.For the example list1 -> 2 -> ... 阅读全文
摘要:
Well, since theheadpointer may also been modified, we create anew_headthat points to it to facilitate the swapping process.For the example list1 -> 2 ... 阅读全文
摘要:
动态规划: 1 class Solution { 2 public: 3 /** 4 * @param s: A string 5 * @param p: A string includes "?" and "*" 6 * @return: A boolean... 阅读全文
摘要:
Well, so many people has tried to solve this problem using DP. And almost all of them get TLE (if you see aC++DP solution that gets accepted, please l... 阅读全文
摘要:
Well, the idea of this problem is actually very sample --- keep merging the unmerged lists in lists until there is exactly one list remained. However,... 阅读全文