Skip to content

Saravana68/Leetcode-300

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 

Repository files navigation

Leetcode - 300 🔥

SARAVANA KUMAR (7)

image

  • âś… I have used C++ language to practice Data structures and algorithms
  • âś… Clicking the title of problem will redirect you to the respective problem page in leetcode
  • âś… Clicking highlighted C++ will redirect you to solution repository.
  • âś… So far I have solved 300+ problems in Leetcode among them 200+ solutions are documented here.
    # Title Solution Runtime
    26 Remove Duplicates from Sorted Array C++ 4 ms
    977 Squares of a Sorted Array C++ 24 ms
    1480 Running Sum of 1d Array C++ 4 ms
    118 Pascal's Triangle C++ 0 ms
    119 Pascal's Triangle II C++ 0 ms
    121 Best Time to Buy and Sell Stock C++ 116 ms
    122 Best Time to Buy and Sell Stock II C++ 4 ms
    509 Fibonacci Number C++ 12 ms
    3 Longest Substring Without Repeating Characters C++ 38 ms
    11 Container With Most Water C++ 250 ms
    15 3Sum C++ 64 ms
    16 3Sum Closest C++ 624 ms
    18 4Sum C++ 320 ms
    20 Valid Parentheses C++ 3 ms
    21 Merge Two Sorted Lists C++ 8 ms
    23 Merge k Sorted Lists C++ 34 ms
    24 Swap Nodes in Pairs C++ 12 ms
    25 Reverse Nodes in k-Group C++ 48 ms
    31 Next Permutation C++ 12 ms
    32 Longest Valid Parentheses C++ 11 ms
    42 Trapping Rain Water C++ 15 ms
    44 Wildcard Matching C++ 52 ms
    45 Jump Game II C++ 191 ms
    55 Jump Game C++ 77 ms
    56 Merge Intervals C++ 80 ms
    57 Insert Interval C++ 16 ms
    59 Spiral Matrix II C++ 0 ms
    61 Rotate List C++ 19 ms
    62 Unique Paths C++ 6 ms
    63 Unique Paths II C++ 7 ms
    70 Climbing Stairs C++ 0 ms
    72 Edit Distance C++ 25 ms
    78 Subsets C++ 4 ms
    82 Remove Duplicates from Sorted List II C++ 12 ms
    83 Remove Duplicates from Sorted List C++ 8 ms
    84 Largest Rectangle in Histogram C++ 279 ms
    85 Maximal Rectangle C++ 53 ms
    86 Partition List C++ 8 ms
    88 Merge Sorted Array C++ 9 ms
    96 Unique Binary Search Trees C++ 0 ms
    97 Interleaving String C++ 4 ms
    100 Same Tree C++ 0 ms
    101 Symmetric Tree C++ 0 ms
    102 Binary Tree Level Order Traversal C++ 7 ms
    103 Binary Tree Zigzag Level Order Traversal C++ 2 ms
    104 Maximum Depth of Binary Tree C++ 12 ms
    105 Construct Binary Tree from Preorder and Inorder Traversal C++ 17 ms
    107 Binary Tree Level Order Traversal II C++ 4 ms
    108 Convert Sorted Array to Binary Search Tree C++ 8 ms
    109 Convert Sorted List to Binary Search Tree C++ 75 ms
    110 Balanced Binary Tree C++ 32 ms
    111 Minimum Depth of Binary Tree C++ 357 ms
    112 Path Sum C++ 20 ms
    113 Path Sum II C++ 24 ms
    114 Flatten Binary Tree to Linked List C++ 27 ms
    116 Populating Next Right Pointers in Each Node C++ 62 ms
    117 Populating Next Right Pointers in Each Node II C++ 42 ms
    118 Pascal's Triangle C++ 0 ms
    119 Pascal's Triangle II C++ 6 ms
    120 Triangle C++ 23 ms
    121 Best Time to Buy and Sell Stock C++ 207 ms
    127 Word Ladder C++ 1642 ms
    130 Surrounded Regions C++ 42 ms
    133 Clone Graph C++ 4 ms
    134 Gas Station C++ 88 ms
    138 Copy List with Random Pointer C++ 11 ms
    139 Word Break C++ 11 ms
    140 Word Break II C++ 4 ms
    141 Linked List Cycle C++ 12 ms
    142 Linked List Cycle II C++ 8 ms
    144 Binary Tree Preorder Traversal C++ 0 ms
    148 Sort List C++ 207 ms
    149 Max Points on a Line C++ 22 ms
    152 Maximum Product Subarray C++ 10 ms
    155 Min Stack C++ 16 ms
    160 Intersection of Two Linked Lists C++ 36 ms
    169 Majority Element C++ 28 ms
    173 Binary Search Tree Iterator C++ 37 ms
    183 Customers Who Never Order MySQL 909 ms
    198 House Robber C++ 3 ms
    200 Number of Islands C++ 28 ms
    203 Remove Linked List Elements C++ 20 ms
    207 Course Schedule C++ 88 ms
    209 Minimum Size Subarray Sum C++ 326 ms
    210 Course Schedule II C++ 59 ms
    213 House Robber II C++ 0 ms
    215 Kth Largest Element in an Array C++ 4 ms
    218 The Skyline Problem C++ 28 ms
    222 Count Complete Tree Nodes C++ 68 ms
    225 Implement Stack using Queues C++ 3 ms
    226 Invert Binary Tree C++ 4 ms
    229 Majority Element II C++ 7 ms
    234 Palindrome Linked List C++ 220 ms
    236 Lowest Common Ancestor of a Binary Tree C++ 19 ms
    238 Product of Array Except Self C++ 46 ms
    239 Sliding Window Maximum C++ 256 ms
    257 Binary Tree Paths C++ 13 ms
    287 Find the Duplicate Number C++ 88 ms
    289 Game of Life C++ 0 ms
    295 Find Median from Data Stream C++ 731 ms
    300 Longest Increasing Subsequence C++ 4 ms
    312 Burst Balloons C++ 280 ms
    322 Coin Change C++ 60 ms
    329 Longest Increasing Path in a Matrix C++ 41 ms
    337 House Robber III C++ 20 ms
    347 Top K Frequent Elements C++ 28 ms
    380 Insert Delete GetRandom O(1) C++ 180 ms
    381 Insert Delete GetRandom O(1) - Duplicates allowed C++ 367 ms
    404 Sum of Left Leaves C++ 3 ms
    416 Partition Equal Subset Sum C++ 818 ms
    442 Find All Duplicates in an Array C++ 44 ms
    455 Assign Cookies C++ 64 ms
    486 Predict the Winner C++ 8 ms
    494 Target Sum C++ 4 ms
    498 Diagonal Traverse C++ 261 ms
    508 Most Frequent Subtree Sum C++ 48 ms
    523 Continuous Subarray Sum C++ 302 ms
    530 Minimum Absolute Difference in BST C++ 24 ms
    532 K-diff Pairs in an Array C++ 16 ms
    542 01 Matrix C++ 66 ms
    543 Diameter of Binary Tree C++ 11 ms
    547 Number of Provinces C++ 64 ms
    560 Subarray Sum Equals K C++ 180 ms
    572 Subtree of Another Tree C++ 72 ms
    581 Shortest Unsorted Continuous Subarray C++ 26 ms
    584 Find Customer Referee MySQL 701 ms
    595 Big Countries MySQL 355 ms
    599 Minimum Index Sum of Two Lists C++ 116 ms
    606 Construct String from Binary Tree C++ 24 ms
    617 Merge Two Binary Trees C++ 89 ms
    652 Find Duplicate Subtrees C++ 106 ms
    662 Maximum Width of Binary Tree C++ 8 ms
    678 Valid Parenthesis String C++ 0 ms
    695 Max Area of Island C++ 16 ms
    704 Binary Search C++ 49 ms
    713 Subarray Product Less Than K C++ 138 ms
    721 Accounts Merge C++ 190 ms
    724 Find Pivot Index C++ 48 ms
    739 Daily Temperatures C++ 223 ms
    743 Network Delay Time C++ 150 ms
    767 Reorganize String C++ 0 ms
    778 Swim in Rising Water C++ 53 ms
    785 Is Graph Bipartite? C++ 65 ms
    786 K-th Smallest Prime Fraction C++ 16 ms
    787 Cheapest Flights Within K Stops C++ 35 ms
    802 Find Eventual Safe States C++ 477 ms
    841 Keys and Rooms C++ 17 ms
    844 Backspace String Compare C++ 5 ms
    872 Leaf-Similar Trees C++ 0 ms
    889 Construct Binary Tree from Preorder and Postorder Traversal C++ 8 ms
    901 Online Stock Span C++ 216 ms
    909 Snakes and Ladders C++ 12 ms
    918 Maximum Sum Circular Subarray C++ 79 ms
    921 Minimum Add to Make Parentheses Valid C++ 0 ms
    947 Most Stones Removed with Same Row or Column C++ 730 ms
    958 Check Completeness of a Binary Tree C++ 16 ms
    968 Binary Tree Cameras C++ 21 ms
    974 Subarray Sums Divisible by K C++ 60 ms
    994 Rotting Oranges C++ 10 ms
    1008 Construct Binary Search Tree from Preorder Traversal C++ 14 ms
    1010 Pairs of Songs With Total Durations Divisible by 60 C++ 81 ms
    1010 Pairs of Songs With Total Durations Divisible by 60 C++ 28 ms
    1022 Sum of Root To Leaf Binary Numbers C++ 13 ms
    1047 Remove All Adjacent Duplicates In String C++ 63 ms
    1091 Shortest Path in Binary Matrix C++ 161 ms
    1209 Remove All Adjacent Duplicates in String II C++ 33 ms
    1235 Maximum Profit in Job Scheduling C++ 96 ms
    1249 Minimum Remove to Make Valid Parentheses C++ N/A
    1277 Count Square Submatrices with All Ones C++ 79 ms
    1319 Number of Operations to Make Network Connected C++ 283 ms
    1325 Delete Leaves With a Given Value C++ 22 ms
    1334 Find the City With the Smallest Number of Neighbors at a Threshold Distance C++ 206 ms
    1352 Product of the Last K Numbers C++ 162 ms
    1353 Maximum Number of Events That Can Be Attended C++ 312 ms
    1377 Frog Position After T Seconds C++ 78 ms
    1423 Maximum Points You Can Obtain from Cards C++ 211 ms
    1443 Minimum Time to Collect All Apples in a Tree C++ 162 ms
    1465 Maximum Area of a Piece of Cake After Horizontal and Vertical Cuts C++ 60 ms
    28 Implement strStr() C++ 12 ms
    415 Add Strings C++ 8 ms
    21 Merge Two Sorted Lists C++ 8 ms
    206 Reverse Linked List C++ 4 ms
    234 Palindrome Linked List C++ 220 ms
    2 Add Two Numbers C++ 32 ms
    138 Copy List with Random Pointer C++ 8 ms
    92 Reverse Linked List II C++ 4 ms
    445 Add Two Numbers II C++ 88 ms
    19 Remove Nth Node From End of List C++ 3 ms
    143 Reorder List C++ 51 ms
    328 Odd Even Linked List C++ 8 ms
    1470 Shuffle the Array C++ 7 ms
    1519 Number of Nodes in the Sub-Tree With the Same Label C++ 618 ms
    1541 Minimum Insertions to Balance a Parentheses String C++ 62 ms
    1557 Minimum Number of Vertices to Reach All Nodes C++ 526 ms
    1561 Maximum Number of Coins You Can Get C++ 140 ms
    1584 Min Cost to Connect All Points C++ 1009 ms
    1629 Slowest Key C++ 19 ms
    1631 Path With Minimum Effort C++ 396 ms
    1642 Furthest Building You Can Reach C++ 278 ms
    1696 Jump Game VI C++ 216 ms
    1757 Recyclable and Low Fat Products MySQL 748 ms
    1785 Minimum Elements to Add to Form a Given Sum C++ 353 ms
    1814 Count Nice Pairs in an Array C++ 308 ms
    1823 Find the Winner of the Circular Game C++ 74 ms
    1833 Maximum Ice Cream Bars C++ 378 ms
    1873 Calculate Special Bonus MySQL 789 ms
    1976 Number of Ways to Arrive at Destination C++ 208 ms
    2074 Reverse Nodes in Even Length Groups C++ 1342 ms
    2095 Delete the Middle Node of a Linked List C++ 1487 ms
    2130 Maximum Twin Sum of a Linked List C++ 950 ms
    2231 Largest Number After Digit Swaps by Parity C++ 0 ms
    2232 Minimize Result by Adding Parentheses to Expression C++ 0 ms
    2236 Root Equals Sum of Children C++ 0 ms
    2244 Minimum Rounds to Complete All Tasks C++ 471 ms
    2246 Longest Path With Different Adjacent Characters C++ 380 ms
    2300 Successful Pairs of Spells and Potions C++ 238 ms
    2364 Count Number of Bad Pairs C++ 387 ms
    2467 Most Profitable Path in a Tree C++ 456 ms
    2531 Make Number of Distinct Characters Equal C++ 57 ms
  • About

    No description, website, or topics provided.

    Resources

    Stars

    Watchers

    Forks

    Releases

    No releases published

    Packages

    No packages published

    Languages