摘要:
The most interesting, flexible and juicy binary tree problem I have ever seen.I learnt it from here: https://codepair.hackerrank.com/paper/5fIoGg74?b=... 阅读全文
摘要:
XOR -> 0 is the key (make it even pair): http://www.cnblogs.com/lautsie/p/3908006.htmlSomething to learn about basic Game Theory: http://www.cdf.toron... 阅读全文
摘要:
A typical game theory problem - Recursion + Memorized Searchhttp://justprogrammng.blogspot.com/2012/06/interviewstreet-challenges-permutation.html#.Vl... 阅读全文
摘要:
Same as LintCode "Sliding Window Median", but requires more care on details - no trailing zeroes.#include #include #include #include #include #include... 阅读全文
摘要:
Something to learn: Rotation ops in AVL tree does not require recursion.https://github.com/andreimaximov/hacker-rank/blob/master/data-structures/tree/... 阅读全文
摘要:
Something to learn:http://blog.csdn.net/yuwenshi/article/details/36666453Shortest Job First Algorithm - kinda greedy: we do shorter job first BUT we o... 阅读全文
摘要:
A natural DFS thought. Several pruning tricks can be applied. Please take care of date type(long long).class Solution { bool _check(string a, strin... 阅读全文
摘要:
Here is the thought flow: we are trying 'find' the boundary - it is a search, so binary search.class Solution { bool isRowHit(vector>& image, int r) ... 阅读全文
摘要:
Nice one to learn: DP + Game Theoryhttps://lefttree.gitbooks.io/leetcode/content/dynamicProgramming2/coinsInLine2.htmlIn game theory, we assume the ot... 阅读全文
摘要:
1AC! Yes! Intuitive thought will be: we walk from up-left to down-right - but we should only walk along the 'lowest edge' in the sorted matrix - so it... 阅读全文
摘要:
DFS with pruning. The thought flow: for each char, we have 2 choices: pick or not - then DFS.class Solution { int len; unordered_set rec; vector ... 阅读全文
摘要:
Simply a variation to "Permutation Index". When calculating current digit index, we consider duplicated case.Again, similar as "Digit Counts", it is a... 阅读全文