Skip to content

Latest commit

 

History

History
388 lines (384 loc) · 76.5 KB

File metadata and controls

388 lines (384 loc) · 76.5 KB

LeetCode Problems' Solutions [力扣 ∙ 话题分类]

Go codecov Go Report Card GitHub contributors license FOSSA Status Join the chat

[1-50] [51-100] [101-150] [151-200] [201-250] [251-300]
[301-350] [351-400] [401-450] [451-500] [501-550] [551-600]
[601-650] [651-700] [701-750] [751-800] [801-850] [851-900]
[901-950] [951-1000] [1001-1050] [1051-1100] [1101-1150] [1151-1200]
[1201-1250] [1251-1300] [1301-1350] [1351-1400] [1401-1450] [1451-1500]
[1501-1550] [1551-1600] [1601-1650] [1651-1700] [1701-1750] [1751-1800]
[1801-1850] [1851-1900] [1901-1950] [1951-2000] [2001-2050] [2051-2100]
[2101-2150] [2151-2200] [2201-2250] [2251-2300] [2301-2350] [2351-2400]
# Title Solution Difficulty
1501 Countries You Can Safely Invest In 🔒 MySQL Medium
1502 Can Make Arithmetic Progression From Sequence Go Easy
1503 Last Moment Before All Ants Fall Out of a Plank Go Medium
1504 Count Submatrices With All Ones Go Medium
1505 Minimum Possible Integer After at Most K Adjacent Swaps On Digits Go Hard
1506 Find Root of N-Ary Tree 🔒 Go Medium
1507 Reformat Date Go Easy
1508 Range Sum of Sorted Subarray Sums Go Medium
1509 Minimum Difference Between Largest and Smallest Value in Three Moves Go Medium
1510 Stone Game IV Go Hard
1511 Customer Order Frequency 🔒 MySQL Easy
1512 Number of Good Pairs Go Easy
1513 Number of Substrings With Only 1s Go Medium
1514 Path with Maximum Probability Go Medium
1515 Best Position for a Service Centre Go Hard
1516 Move Sub-Tree of N-Ary Tree 🔒 Go Hard
1517 Find Users With Valid E-Mails 🔒 MySQL Easy
1518 Water Bottles Go Easy
1519 Number of Nodes in the Sub-Tree With the Same Label Go Medium
1520 Maximum Number of Non-Overlapping Substrings Go Hard
1521 Find a Value of a Mysterious Function Closest to Target Go Hard
1522 Diameter of N-Ary Tree 🔒 Go Medium
1523 Count Odd Numbers in an Interval Range Go Easy
1524 Number of Sub-arrays With Odd Sum Go Medium
1525 Number of Good Ways to Split a String Go Medium
1526 Minimum Number of Increments on Subarrays to Form a Target Array Go Hard
1527 Patients With a Condition 🔒 MySQL Easy
1528 Shuffle String Go Easy
1529 Minimum Suffix Flips Go Medium
1530 Number of Good Leaf Nodes Pairs Go Medium
1531 String Compression II Go Hard
1532 The Most Recent Three Orders 🔒 MySQL Medium
1533 Find the Index of the Large Integer 🔒 Go Medium
1534 Count Good Triplets Go Easy
1535 Find the Winner of an Array Game Go Medium
1536 Minimum Swaps to Arrange a Binary Grid Go Medium
1537 Get the Maximum Score Go Hard
1538 Guess the Majority in a Hidden Array 🔒 Go Medium
1539 Kth Missing Positive Number Go Easy
1540 Can Convert String in K Moves Go Medium
1541 Minimum Insertions to Balance a Parentheses String Go Medium
1542 Find Longest Awesome Substring Go Hard
1543 Fix Product Name Format 🔒 MySQL Easy
1544 Make The String Great Go Easy
1545 Find Kth Bit in Nth Binary String Go Medium
1546 Maximum Number of Non-Overlapping Subarrays With Sum Equals Target Go Medium
1547 Minimum Cost to Cut a Stick Go Hard
1548 The Most Similar Path in a Graph 🔒 Go Hard
1549 The Most Recent Orders for Each Product 🔒 MySQL Medium
1550 Three Consecutive Odds Go Easy
1551 Minimum Operations to Make Array Equal Go Medium
1552 Magnetic Force Between Two Balls Go Medium
1553 Minimum Number of Days to Eat N Oranges Go Hard
1554 Strings Differ by One Character 🔒 Go Medium
1555 Bank Account Summary 🔒 MySQL Medium
1556 Thousand Separator Go Easy
1557 Minimum Number of Vertices to Reach All Nodes Go Medium
1558 Minimum Numbers of Function Calls to Make Target Array Go Medium
1559 Detect Cycles in 2D Grid Go Medium
1560 Most Visited Sector in a Circular Track Go Easy
1561 Maximum Number of Coins You Can Get Go Medium
1562 Find Latest Group of Size M Go Medium
1563 Stone Game V Go Hard
1564 Put Boxes Into the Warehouse I 🔒 Go Medium
1565 Unique Orders and Customers Per Month 🔒 MySQL Easy
1566 Detect Pattern of Length M Repeated K or More Times Go Easy
1567 Maximum Length of Subarray With Positive Product Go Medium
1568 Minimum Number of Days to Disconnect Island Go Hard
1569 Number of Ways to Reorder Array to Get Same BST Go Hard
1570 Dot Product of Two Sparse Vectors 🔒 Go Medium
1571 Warehouse Manager 🔒 MySQL Easy
1572 Matrix Diagonal Sum Go Easy
1573 Number of Ways to Split a String Go Medium
1574 Shortest Subarray to be Removed to Make Array Sorted Go Medium
1575 Count All Possible Routes Go Hard
1576 Replace All ?'s to Avoid Consecutive Repeating Characters Go Easy
1577 Number of Ways Where Square of Number Is Equal to Product of Two Numbers Go Medium
1578 Minimum Time to Make Rope Colorful Go Medium
1579 Remove Max Number of Edges to Keep Graph Fully Traversable Go Hard
1580 Put Boxes Into the Warehouse II 🔒 Go Medium
1581 Customer Who Visited but Did Not Make Any Transactions 🔒 MySQL Easy
1582 Special Positions in a Binary Matrix Go Easy
1583 Count Unhappy Friends Go Medium
1584 Min Cost to Connect All Points Go Medium
1585 Check If String Is Transformable With Substring Sort Operations Go Hard
1586 Binary Search Tree Iterator II 🔒 Go Medium
1587 Bank Account Summary II 🔒 MySQL Easy
1588 Sum of All Odd Length Subarrays Go Easy
1589 Maximum Sum Obtained of Any Permutation Go Medium
1590 Make Sum Divisible by P Go Medium
1591 Strange Printer II Go Hard
1592 Rearrange Spaces Between Words Go Easy
1593 Split a String Into the Max Number of Unique Substrings Go Medium
1594 Maximum Non Negative Product in a Matrix Go Medium
1595 Minimum Cost to Connect Two Groups of Points Go Hard
1596 The Most Frequently Ordered Products for Each Customer 🔒 MySQL Medium
1597 Build Binary Expression Tree From Infix Expression 🔒 Go Hard
1598 Crawler Log Folder Go Easy
1599 Maximum Profit of Operating a Centennial Wheel Go Medium
1600 Throne Inheritance Go Medium
1601 Maximum Number of Achievable Transfer Requests Go Hard
1602 Find Nearest Right Node in Binary Tree 🔒 Go Medium
1603 Design Parking System Go Easy
1604 Alert Using Same Key-Card Three or More Times in a One Hour Period Go Medium
1605 Find Valid Matrix Given Row and Column Sums Go Medium
1606 Find Servers That Handled Most Number of Requests Go Hard
1607 Sellers With No Sales 🔒 MySQL Easy
1608 Special Array With X Elements Greater Than or Equal X Go Easy
1609 Even Odd Tree Go Medium
1610 Maximum Number of Visible Points Go Hard
1611 Minimum One Bit Operations to Make Integers Zero Go Hard
1612 Check If Two Expression Trees are Equivalent 🔒 Go Medium
1613 Find the Missing IDs 🔒 MySQL Medium
1614 Maximum Nesting Depth of the Parentheses Go Easy
1615 Maximal Network Rank Go Medium
1616 Split Two Strings to Make Palindrome Go Medium
1617 Count Subtrees With Max Distance Between Cities Go Hard
1618 Maximum Font to Fit a Sentence in a Screen 🔒 Go Medium
1619 Mean of Array After Removing Some Elements Go Easy
1620 Coordinate With Maximum Network Quality Go Medium
1621 Number of Sets of K Non-Overlapping Line Segments Go Medium
1622 Fancy Sequence Go Hard
1623 All Valid Triplets That Can Represent a Country 🔒 MySQL Easy
1624 Largest Substring Between Two Equal Characters Go Easy
1625 Lexicographically Smallest String After Applying Operations Go Medium
1626 Best Team With No Conflicts Go Medium
1627 Graph Connectivity With Threshold Go Hard
1628 Design an Expression Tree With Evaluate Function 🔒 Go Medium
1629 Slowest Key Go Easy
1630 Arithmetic Subarrays Go Medium
1631 Path With Minimum Effort Go Medium
1632 Rank Transform of a Matrix Go Hard
1633 Percentage of Users Attended a Contest 🔒 MySQL Easy
1634 Add Two Polynomials Represented as Linked Lists 🔒 Go Medium
1635 Hopper Company Queries I 🔒 MySQL Hard
1636 Sort Array by Increasing Frequency Go Easy
1637 Widest Vertical Area Between Two Points Containing No Points Go Medium
1638 Count Substrings That Differ by One Character Go Medium
1639 Number of Ways to Form a Target String Given a Dictionary Go Hard
1640 Check Array Formation Through Concatenation Go Easy
1641 Count Sorted Vowel Strings Go Medium
1642 Furthest Building You Can Reach Go Medium
1643 Kth Smallest Instructions Go Hard
1644 Lowest Common Ancestor of a Binary Tree II 🔒 Go Medium
1645 Hopper Company Queries II 🔒 MySQL Hard
1646 Get Maximum in Generated Array Go Easy
1647 Minimum Deletions to Make Character Frequencies Unique Go Medium
1648 Sell Diminishing-Valued Colored Balls Go Medium
1649 Create Sorted Array through Instructions Go Hard
1650 Lowest Common Ancestor of a Binary Tree III 🔒 Go Medium
1651 Hopper Company Queries III 🔒 MySQL Hard
1652 Defuse the Bomb Go Easy
1653 Minimum Deletions to Make String Balanced Go Medium
1654 Minimum Jumps to Reach Home Go Medium
1655 Distribute Repeating Integers Go Hard
1656 Design an Ordered Stream Go Easy
1657 Determine if Two Strings Are Close Go Medium
1658 Minimum Operations to Reduce X to Zero Go Medium
1659 Maximize Grid Happiness Go Hard
1660 Correct a Binary Tree 🔒 Go Medium
1661 Average Time of Process per Machine 🔒 MySQL Easy
1662 Check If Two String Arrays are Equivalent Go Easy
1663 Smallest String With A Given Numeric Value Go Medium
1664 Ways to Make a Fair Array Go Medium
1665 Minimum Initial Energy to Finish Tasks Go Hard
1666 Change the Root of a Binary Tree 🔒 Go Medium
1667 Fix Names in a Table 🔒 MySQL Easy
1668 Maximum Repeating Substring Go Easy
1669 Merge In Between Linked Lists Go Medium
1670 Design Front Middle Back Queue Go Medium
1671 Minimum Number of Removals to Make Mountain Array Go Hard
1672 Richest Customer Wealth Go Easy
1673 Find the Most Competitive Subsequence Go Medium
1674 Minimum Moves to Make Array Complementary Go Medium
1675 Minimize Deviation in Array Go Hard
1676 Lowest Common Ancestor of a Binary Tree IV 🔒 Go Medium
1677 Product's Worth Over Invoices 🔒 MySQL Easy
1678 Goal Parser Interpretation Go Easy
1679 Max Number of K-Sum Pairs Go Medium
1680 Concatenation of Consecutive Binary Numbers Go Medium
1681 Minimum Incompatibility Go Hard
1682 Longest Palindromic Subsequence II 🔒 Go Medium
1683 Invalid Tweets 🔒 MySQL Easy
1684 Count the Number of Consistent Strings Go Easy
1685 Sum of Absolute Differences in a Sorted Array Go Medium
1686 Stone Game VI Go Medium
1687 Delivering Boxes from Storage to Ports Go Hard
1688 Count of Matches in Tournament Go Easy
1689 Partitioning Into Minimum Number Of Deci-Binary Numbers Go Medium
1690 Stone Game VII Go Medium
1691 Maximum Height by Stacking Cuboids Go Hard
1692 Count Ways to Distribute Candies 🔒 Go Hard
1693 Daily Leads and Partners 🔒 MySQL Easy
1694 Reformat Phone Number Go Easy
1695 Maximum Erasure Value Go Medium
1696 Jump Game VI Go Medium
1697 Checking Existence of Edge Length Limited Paths Go Hard
1698 Number of Distinct Substrings in a String 🔒 Go Medium
1699 Number of Calls Between Two Persons 🔒 MySQL Medium
1700 Number of Students Unable to Eat Lunch Go Easy
1701 Average Waiting Time Go Medium
1702 Maximum Binary String After Change Go Medium
1703 Minimum Adjacent Swaps for K Consecutive Ones Go Hard
1704 Determine if String Halves Are Alike Go Easy
1705 Maximum Number of Eaten Apples Go Medium
1706 Where Will the Ball Fall Go Medium
1707 Maximum XOR With an Element From Array Go Hard
1708 Largest Subarray Length K 🔒 Go Easy
1709 Biggest Window Between Visits 🔒 MySQL Medium
1710 Maximum Units on a Truck Go Easy
1711 Count Good Meals Go Medium
1712 Ways to Split Array Into Three Subarrays Go Medium
1713 Minimum Operations to Make a Subsequence Go Hard
1714 Sum Of Special Evenly-Spaced Elements In Array 🔒 Go Hard
1715 Count Apples and Oranges 🔒 MySQL Medium
1716 Calculate Money in Leetcode Bank Go Easy
1717 Maximum Score From Removing Substrings Go Medium
1718 Construct the Lexicographically Largest Valid Sequence Go Medium
1719 Number Of Ways To Reconstruct A Tree Go Hard
1720 Decode XORed Array Go Easy
1721 Swapping Nodes in a Linked List Go Medium
1722 Minimize Hamming Distance After Swap Operations Go Medium
1723 Find Minimum Time to Finish All Jobs Go Hard
1724 Checking Existence of Edge Length Limited Paths II 🔒 Go Hard
1725 Number Of Rectangles That Can Form The Largest Square Go Easy
1726 Tuple with Same Product Go Medium
1727 Largest Submatrix With Rearrangements Go Medium
1728 Cat and Mouse II Go Hard
1729 Find Followers Count 🔒 MySQL Easy
1730 Shortest Path to Get Food 🔒 Go Medium
1731 The Number of Employees Which Report to Each Employee 🔒 MySQL Easy
1732 Find the Highest Altitude Go Easy
1733 Minimum Number of People to Teach Go Medium
1734 Decode XORed Permutation Go Medium
1735 Count Ways to Make Array With Product Go Hard
1736 Latest Time by Replacing Hidden Digits Go Easy
1737 Change Minimum Characters to Satisfy One of Three Conditions Go Medium
1738 Find Kth Largest XOR Coordinate Value Go Medium
1739 Building Boxes Go Hard
1740 Find Distance in a Binary Tree 🔒 Go Medium
1741 Find Total Time Spent by Each Employee 🔒 MySQL Easy
1742 Maximum Number of Balls in a Box Go Easy
1743 Restore the Array From Adjacent Pairs Go Medium
1744 Can You Eat Your Favorite Candy on Your Favorite Day? Go Medium
1745 Palindrome Partitioning IV Go Hard
1746 Maximum Subarray Sum After One Operation 🔒 Go Medium
1747 Leetflex Banned Accounts 🔒 MySQL Medium
1748 Sum of Unique Elements Go Easy
1749 Maximum Absolute Sum of Any Subarray Go Medium
1750 Minimum Length of String After Deleting Similar Ends Go Medium
1751 Maximum Number of Events That Can Be Attended II Go Hard
1752 Check if Array Is Sorted and Rotated Go Easy
1753 Maximum Score From Removing Stones Go Medium
1754 Largest Merge Of Two Strings Go Medium
1755 Closest Subsequence Sum Go Hard
1756 Design Most Recently Used Queue 🔒 Go Medium
1757 Recyclable and Low Fat Products 🔒 MySQL Easy
1758 Minimum Changes To Make Alternating Binary String Go Easy
1759 Count Number of Homogenous Substrings Go Medium
1760 Minimum Limit of Balls in a Bag Go Medium
1761 Minimum Degree of a Connected Trio in a Graph Go Hard
1762 Buildings With an Ocean View 🔒 Go Medium
1763 Longest Nice Substring Go Easy
1764 Form Array by Concatenating Subarrays of Another Array Go Medium
1765 Map of Highest Peak Go Medium
1766 Tree of Coprimes Go Hard
1767 Find the Subtasks That Did Not Execute 🔒 MySQL Hard
1768 Merge Strings Alternately Go Easy
1769 Minimum Number of Operations to Move All Balls to Each Box Go Medium
1770 Maximum Score from Performing Multiplication Operations Go Medium
1771 Maximize Palindrome Length From Subsequences Go Hard
1772 Sort Features by Popularity 🔒 Go Medium
1773 Count Items Matching a Rule Go Easy
1774 Closest Dessert Cost Go Medium
1775 Equal Sum Arrays With Minimum Number of Operations Go Medium
1776 Car Fleet II Go Hard
1777 Product's Price for Each Store 🔒 MySQL Easy
1778 Shortest Path in a Hidden Grid 🔒 Go Medium
1779 Find Nearest Point That Has the Same X or Y Coordinate Go Easy
1780 Check if Number is a Sum of Powers of Three Go Medium
1781 Sum of Beauty of All Substrings Go Medium
1782 Count Pairs Of Nodes Go Hard
1783 Grand Slam Titles 🔒 MySQL Medium
1784 Check if Binary String Has at Most One Segment of Ones Go Easy
1785 Minimum Elements to Add to Form a Given Sum Go Medium
1786 Number of Restricted Paths From First to Last Node Go Medium
1787 Make the XOR of All Segments Equal to Zero Go Hard
1788 Maximize the Beauty of the Garden 🔒 Go Hard
1789 Primary Department for Each Employee 🔒 MySQL Easy
1790 Check if One String Swap Can Make Strings Equal Go Easy
1791 Find Center of Star Graph Go Easy
1792 Maximum Average Pass Ratio Go Medium
1793 Maximum Score of a Good Subarray Go Hard
1794 Count Pairs of Equal Substrings With Minimum Difference 🔒 Go Medium
1795 Rearrange Products Table 🔒 MySQL Easy
1796 Second Largest Digit in a String Go Easy
1797 Design Authentication Manager Go Medium
1798 Maximum Number of Consecutive Values You Can Make Go Medium
1799 Maximize Score After N Operations Go Hard
1800 Maximum Ascending Subarray Sum Go Easy