算法竞赛
Demon的黑与白
Stay hungry,Stay foolish
展开
-
LeetCode Weekly Contest 24 之 543. Diameter of Binary Tree
LeetCode Weekly Contest 24赛题本次周赛主要分为一下4道题:543 Diameter of Binary Tree (4分)538 Convert BST to Greater Tree (6分)542 01 Matrix (7分)544 Output Contest Matches (7分)543 Diameter of Binary TreeProblem:原创 2017-03-19 14:45:51 · 686 阅读 · 0 评论 -
LeetCode Weekly Contest 24 之 538.Convert BST to Greater Tree
LeetCode Weekly Contest 24赛题本次周赛主要分为一下4道题:543 Diameter of Binary Tree (4分)538 Convert BST to Greater Tree (6分)542 01 Matrix (7分)544 Output Contest Matches (7分)538 Convert BST to Greater TreeProble原创 2017-03-19 19:33:36 · 1112 阅读 · 0 评论 -
LeetCode Weekly Contest 24 之 542.01 Matrix
LeetCode Weekly Contest 24赛题本次周赛主要分为一下4道题:543 Diameter of Binary Tree (4分)538 Convert BST to Greater Tree (6分)542 01 Matrix (7分)544 Output Contest Matches (7分)542 01 MatrixProblem: Given a matri原创 2017-03-20 16:37:36 · 1436 阅读 · 2 评论 -
LeetCode Weekly Contest 23 之 541. Reverse String II
LeetCode Weekly Contest 23业余时间做做算法题还是挺有意思的,这些题目都是每周的限时竞赛题目,新鲜出炉,所以还有很多可以改进的地方。但对我来说,该系列的总结给我带来的是:在有限的时间内,突破自身能力限制,在没有任何算法经验的情况下,训练自己的临时解题能力,能够极大效率地提升算法能力。记录整个解题的思维过程,以及赛后的复盘,力求发现赛题背后的本质,举一反三。完善算法细节,原创 2017-03-12 15:36:03 · 482 阅读 · 0 评论 -
LeetCode Weekly Contest 23 之 539. Minimum Time Difference
LeetCode Weekly Contest 23赛题本次周赛主要分为三道题:541 Reverse String II (3分)539 Minimum Time Difference (5分)536 Construct Binary Tree from String (6分)527 Word Abbreviation (8分)539 Minimum Time Di原创 2017-03-12 16:23:01 · 583 阅读 · 0 评论 -
LeetCode Weekly Contest 23 之 536.Construct Binary Tree from String
LeetCode Weekly Contest 23赛题本次周赛主要分为一下4道题:541 Reverse String II (3分)539 Minimum Time Difference (5分)536 Construct Binary Tree from String (6分)527 Word Abbreviation (8分)536 Construct Binary Tree fr原创 2017-03-12 17:56:59 · 884 阅读 · 2 评论 -
LeetCode Weekly Contest 27解题思路
LeetCode Weekly Contest 27解题思路赛题本次周赛主要分为以下4道题:557 Reverse Words in a String III (3分)554 Brick Wall (6分)556 Next Greater Element III (7分)549 Binary Tree Longest Consecutive Sequence II (9分)557 Reve原创 2017-04-10 20:20:44 · 632 阅读 · 0 评论 -
LeetCode Weekly Contest 25 之 507.Perfect Number
LeetCode Weekly Contest 25赛题本次周赛主要分为以下4道题:507 Perfect Number (3分)537 Complex Number Multiplication (6分)545 boundary of Binary Tree (8分)546 Remove Boxes (9分)507 Perfect NumberProblem: We define t原创 2017-03-26 12:49:06 · 493 阅读 · 0 评论 -
LeetCode Weekly Contest 25 之 537.Complex Number Multiplication
LeetCode Weekly Contest 25赛题本次周赛主要分为以下4道题:507 Perfect Number (3分)537 Complex Number Multiplication (6分)545 boundary of Binary Tree (8分)546 Remove Boxes (9分)537 Complex Number MultiplicationProblem原创 2017-03-26 13:54:28 · 578 阅读 · 0 评论 -
LeetCode Weekly Contest 26解题思路
LeetCode Weekly Contest 26解题思路赛题本次周赛主要分为以下4道题:521 Longest Uncommon Subsequence I (3分)522 Longest Uncommon Subsequence II (6分)547 Friend Circles (7分)548 Split Array with Equal Sum (9分)521 Longest U原创 2017-04-02 18:34:32 · 892 阅读 · 0 评论 -
LeetCode Weekly Contest 25 之 545.Boundary of Binary Tree
LeetCode Weekly Contest 25赛题本次周赛主要分为以下4道题:507 Perfect Number (3分)537 Complex Number Multiplication (6分)545 boundary of Binary Tree (8分)546 Remove Boxes (9分)545 Boundary of Binary TreeProblem: Gi原创 2017-03-26 15:38:39 · 1140 阅读 · 0 评论 -
LeetCode Weekly Contest 28解题思路
LeetCode Weekly Contest 28解题思路赛题本次周赛主要分为以下4道题:551 Student Attendance Record I (3分)553 Optimal Division (6分)555 Split Assembled Strings (8分)552 Student Attendance Record II (10分)551 Student Attenda原创 2017-04-17 17:43:42 · 742 阅读 · 0 评论 -
LeetCode Weekly Contest 30解题思路
LeetCode Weekly Contest 30解题思路赛题本次周赛主要分为以下4道题:566 Reshape the Matrix (3分)560 Subarray Sum Equals K (6分)567 Permutation in String (7分)568 Maximum Vacation Days (9分)566. Reshape the MatrixProblem:原创 2017-04-30 16:46:58 · 2246 阅读 · 0 评论 -
LeetCode Weekly Contest 29解题思路
LeetCode Weekly Contest 29解题思路赛题本次周赛主要分为以下4道题:563 Binary Tree Tilt (3分)561 Array Partition I (6分)562 Longest Line of Consecutive One in Matrix (8分)564 Find the Closest Palindrome (10分)563 Binary T原创 2017-04-23 18:42:31 · 827 阅读 · 0 评论 -
LeetCode Weekly Contest 31解题思路
LeetCode Weekly Contest 31解题思路 详细代码可以fork下Github上[leetcode][1]项目,不定期更新。赛题本次周赛主要分为以下4道题:575 Distribute Candies (4分)572 Subtree of Another Tree (6分)573 Squirrel Simulation (7分)576 Out of Boundary原创 2017-05-07 15:26:37 · 794 阅读 · 0 评论 -
LeetCode Weekly Contest 32解题思路
LeetCode Weekly Contest 32解题思路 详细代码可以fork下Github上leetcode项目,不定期更新。赛题本次周赛主要分为以下4道题:581 Shortest Unsorted Continuous Subarray (4分)582 Kill Process (6分)583 Delete Operation for Two Strings (7分)587原创 2017-05-14 13:28:34 · 1569 阅读 · 0 评论 -
LeetCode Weekly Contest 34解题思路
LeetCode Weekly Contest 34解题思路 详细代码可以fork下Github上leetcode项目,不定期更新。赛题本次周赛主要分为以下4道题:Leetcode 598. Range Addition II (5分)Leetcode 599. Minimum Index Sum of Two Lists (6分)原创 2017-05-30 22:23:40 · 2791 阅读 · 0 评论 -
LeetCode Weekly Contest 33解题思路
LeetCode Weekly Contest 33解题思路 详细代码可以fork下Github上leetcode项目,不定期更新。赛题本次周赛主要分为以下4道题:594 Longest Harmonious Subsequence (3分)593 Valid Square (6分)592 Fraction Addition and Subtraction (7分)588 Design原创 2017-05-21 16:07:41 · 2330 阅读 · 0 评论 -
LeetCode Weekly Contest 37解题思路
LeetCode Weekly Contest 37解题思路 详细代码可以fork下Github上leetcode项目,不定期更新。赛题本次周赛主要分为以下4道题:Leetcode 624. Maximum Distance in ArraysLeetcode 623. Add One Row to TreeLeetcode 625. Minimum FactorizationLeet原创 2017-06-18 15:51:05 · 1357 阅读 · 0 评论 -
LeetCode Weekly Contest 35解题思路
LeetCode Weekly Contest 35解题思路 详细代码可以fork下Github上leetcode项目,不定期更新。赛题本次周赛主要分为以下4道题:Leetcode 605. Can Place Flowers (4分)Leetcode 606. Construct String from Binary Tree (5分)Leetcode 609. Find Duplic原创 2017-06-04 16:34:06 · 1241 阅读 · 0 评论 -
LeetCode Weekly Contest 39解题思路
LeetCode Weekly Contest 39解题思路 详细代码可以fork下Github上leetcode项目,不定期更新。赛题本次周赛主要分为以下4道题:Leetcode 633. Sum of Square NumbersLeetcode 635. Design Log Storage SystemLeetcode 634. Find the Derangement of A原创 2017-07-02 17:57:06 · 1188 阅读 · 0 评论 -
LeetCode Weekly Contest 36解题思路
LeetCode Weekly Contest 36解题思路 详细代码可以fork下Github上leetcode项目,不定期更新。赛题本次周赛主要分为以下4道题:Leetcode 617. Merge Two Binary Trees (4分)Leetcode 604. Design Compressed String Iterator (5分)Leetcode 611. Valid原创 2017-06-12 10:57:41 · 1018 阅读 · 0 评论 -
LeetCode Weekly Contest 38解题思路
LeetCode Weekly Contest 38解题思路 详细代码可以fork下Github上leetcode项目,不定期更新。赛题本次周赛主要分为以下4道题:Leetcode 628. Maximum Product of Three NumbersLeetcode 630. Course Schedule IIILeetcode 629. K Inverse Pairs Arra原创 2017-06-25 18:28:19 · 1442 阅读 · 0 评论 -
LeetCode Weekly Contest 40解题思路
LeetCode Weekly Contest 40解题思路 详细代码可以fork下Github上leetcode项目,不定期更新。赛题本次周赛主要分为以下4道题:Leetcode 637. Average of Levels in Binary TreeLeetcode 640. Solve the EquationLeetcode 638. Shopping OffersLeetc原创 2017-07-17 11:47:22 · 881 阅读 · 0 评论 -
LeetCode Weekly Contest 43解题思路
LeetCode Weekly Contest 43解题思路 详细代码可以fork下Github上leetcode项目,不定期更新。赛题本次周赛主要分为以下4道题:Leetcode 652. Find Duplicate SubtreesLeetcode 650. 2 Keys KeyboardLeetcode 649. Dota2 SenateLeetcode 651. 4 Keys原创 2017-07-30 16:42:04 · 1222 阅读 · 0 评论 -
LeetCode Weekly Contest 41解题思路
LeetCode Weekly Contest 41解题思路 详细代码可以fork下Github上leetcode项目,不定期更新。赛题本次周赛主要分为以下4道题:Leetcode 643. Maximum Average Subarray ILeetcode 636. Exclusive Time of FunctionsLeetcode 644. Maximum Average Su原创 2017-07-17 18:40:51 · 2029 阅读 · 0 评论 -
LeetCode Weekly Contest 42解题思路
LeetCode Weekly Contest 42解题思路 详细代码可以fork下Github上leetcode项目,不定期更新。赛题本次周赛主要分为以下4道题:Leetcode 645. Set MismatchLeetcode 646. Maximum Length of Pair ChainLeetcode 647. Palindromic SubstringsLeetcode原创 2017-07-23 14:55:16 · 777 阅读 · 0 评论 -
LeetCode Weekly Contest 44解题思路
LeetCode Weekly Contest 44解题思路 详细代码可以fork下Github上leetcode项目,不定期更新。赛题本次周赛主要分为以下4道题:Leetcode 653. Two Sum IV - Input is a BSTLeetcode 654. Maximum Binary TreeLeetcode 655. Print Binary TreeLeetcod原创 2017-08-10 08:29:44 · 1310 阅读 · 0 评论 -
LeetCode Weekly Contest 45解题思路
LeetCode Weekly Contest 45解题思路 详细代码可以fork下Github上leetcode项目,不定期更新。赛题本次周赛主要分为以下4道题:Leetcode 657. Judge Route CircleLeetcode 658. Find K Closest ElementsLeetcode 659. Split Array into Consecutive S原创 2017-08-13 17:59:51 · 2670 阅读 · 0 评论 -
LeetCode Weekly Contest 48解题思路
LeetCode Weekly Contest 48解题思路 详细代码可以fork下Github上leetcode项目,不定期更新。赛题本次周赛主要分为以下4道题:Leetcode 671. Second Minimum Node In a Binary TreeLeetcode 669. Trim a Binary Search TreeLeetcode 670. Maximum Sw原创 2017-09-04 10:27:16 · 1011 阅读 · 0 评论 -
LeetCode Weekly Contest 46解题思路
LeetCode Weekly Contest 46解题思路 详细代码可以fork下Github上leetcode项目,不定期更新。赛题本次周赛主要分为以下4道题:Leetcode 661. Image SmootherLeetcode 662. Maximum Width of Binary TreeLeetcode 663. Equal Tree PartitionLeetcode原创 2017-08-21 21:44:47 · 1681 阅读 · 0 评论 -
LeetCode Weekly Contest 47解题思路
LeetCode Weekly Contest 47解题思路 详细代码可以fork下Github上leetcode项目,不定期更新。赛题本次周赛主要分为以下4道题:Leetcode 665. Non-decreasing ArrayLeetcode 666. Path Sum IVLeetcode 667. Beautiful Arrangement IILeetcode 668. K原创 2017-08-28 14:34:48 · 569 阅读 · 0 评论 -
LWC 51:682. Baseball Game
LWC 51:682. Baseball Game传送门:682. Baseball GameProblem: You’re now a baseball game point recorder. Given a list of strings, each string can be one of the 4 following types: Integer (one原创 2017-09-24 12:07:15 · 504 阅读 · 0 评论 -
LWC 51:681. Next Closest Time
LWC 51:681. Next Closest Time传送门:681. Next Closest TimeProblem: Given a time represented in the format “HH:MM”, form the next closest time by reusing the current digits. There is no limit on how many原创 2017-09-24 13:01:48 · 1428 阅读 · 0 评论 -
LWC 51:684. Redundant Connection
LWC 51:684. Redundant Connection传送门:684. Redundant ConnectionProblem: We are given a “tree” in the form of a 2D-array, with distinct values for each node. In the given 2D-array, each element pai原创 2017-09-24 13:44:58 · 819 阅读 · 0 评论 -
LWC 51:683. K Empty Slots
LWC 51:683. K Empty Slots传送门:683. K Empty SlotsProblem: There is a garden with N slots. In each slot, there is a flower. The N flowers will bloom one by one in N days. In each day, there will be exac原创 2017-09-24 14:06:59 · 2205 阅读 · 0 评论 -
LWC 53:693. Binary Number with Alternating Bits
LWC 53:693. Binary Number with Alternating Bits传送门:693. Binary Number with Alternating BitsProblem: Given a positive integer, check whether it has alternating bits: namely, if two adjacent bits will原创 2017-10-08 16:10:51 · 637 阅读 · 0 评论 -
LWC 53:695. Max Area of Island
LWC 53:695. Max Area of Island传送门:695. Max Area of IslandProblem: Given a non-empty 2D array grid of 0’s and 1’s, an island is a group of 1’s (representing land) connected 4-directionally (horizontal原创 2017-10-08 16:20:43 · 1041 阅读 · 0 评论 -
LWC 53:694. Number of Distinct Islands
LWC 53:694. Number of Distinct Islands传送门:694. Number of Distinct IslandsProblem: Given a non-empty 2D array grid of 0’s and 1’s, an island is a group of 1’s (representing land) connected 4-direction原创 2017-10-08 16:56:01 · 1270 阅读 · 0 评论 -
LWC 53:691. Stickers to Spell Word
LWC 53:691. Stickers to Spell Word传送门:691. Stickers to Spell WordProblem: We are given N different types of stickers. Each sticker has a lowercase English word on it. You would like to spell out原创 2017-10-08 18:22:25 · 804 阅读 · 0 评论