摘要:A typical CS style DP based solution: But there's a Math based solution: https://leetcode.com/discuss/98249/easy-to-understand-c-with-explanationIn wh
阅读全文
04 2016 档案
摘要:Fun one! A combination of Greedy and DP. The solution sparkled in my mind - I almost lost it.. Greedy: we sort the input numbers and always pick k con
阅读全文
摘要:It's more of a brain-teaser than a Game Theory problem..
阅读全文
摘要:It is about how to choose btw. BFS and DFS. My init thought was to DFS - TLE\MLE. And its editorial gives a very neat BFS based idea which costs much
阅读全文
摘要:I caught the sparkle in my mind and got AC1 ! It is a great great experience ! So the basic idea: permute on 3 consecutive items doesn't change the pa
阅读全文
摘要:It is marked as a NPC problem. However from the #1 code submission (https://www.hackerrank.com/CharlesOfria), it looks pretty much like a Brutal-Force
阅读全文
摘要:I saw the same sub-problem in LeetCode, and there exists a O(n) neat greedy solution: Please note: '[' is the first char after 'Z'.
阅读全文
摘要:Typical topological sorting problem .. why is it 'difficult'?
阅读全文
摘要:Great learning for me:https://www.hackerrank.com/rest/contests/master/challenges/lucky-numbers/hackers/turuthok/download_solution Basically it is memo
阅读全文
摘要:Besides the common stack-based solutions, here is another recursive NestedIterator solution :) And here's my stack-based solution:
阅读全文
摘要:A simple variation to "Longest Substring with At Most Two Distinct Characters". A typical sliding window problem.
阅读全文
摘要:Nothing special. Just take care of corner cases. class Solution { public: /** * @param head a ListNode * @oaram v1 an integer * @param v2 an integer *
阅读全文

浙公网安备 33010602011771号