摘要:This is 'Difficult' - I worked out it within 45mins, and unlocked HackerRank Algorithm Level 80 yeah! So the idea is straight forward: 1. sort the inp
阅读全文
01 2016 档案
摘要:Just for study from its editorial~Lesson learnt: an optimized Hungarian Algorithm: Hopcroft-Karp Algorithm (a batched version of Hungarian)A very good...
阅读全文
摘要:Interesting Greedy.. classichttps://leetcode.com/discuss/75529/c-simple-solution-easy-understandingclass Solution {public: string removeDuplicateLe...
阅读全文
摘要:My naive Fenwick solution (value space) failed with the last test case in which there's INT_MIN\INT_MAX..So I learnt a smarter thought on Fenwick:http...
阅读全文
摘要:Visualize the unzip process.class Solution {public: ListNode* oddEvenList(ListNode* head) { if (!head || !head->next) return head; Li...
阅读全文
摘要:Nothing special. Point is, how clean can you do it?class Solution {public: int maxSubArrayLen(vector& nums, int k) { int n = nums.size()...
阅读全文
摘要:1AC. Intuitive DP. But please note the if condition, there's a trick - we cannot build upon an invalid dp slot.class Solution {public: int coinChan...
阅读全文

浙公网安备 33010602011771号