Skip to content

ThisIsSakshi/Leetcode-Solutions-2023

Repository files navigation

Header Header

LeetCode Solutions

Jan Challenge:

1: 520. Detect Capital.py

2: 290. Word Pattern.py

3: 944. Delete Columns to Make Sorted.py

4: 2244. Minimum Rounds to Complete All Tasks.py

5: 452. Minimum Number of Arrows to Burst Balloons.py

6: 1833. Maximum Ice Cream Bars.py

7: 134. Gas Station.py

8: 149. Max Points on a Line.py

9: 144. Binary Tree Preorder Traversal.py

10: 100. Same Tree.py

11: 1443. Minimum Time to Collect All Apples in a Tree.py

12: 1519. Number of Nodes in the Sub-Tree With the Same Label.py

13: 2246. Longest Path With Different Adjacent Characters.py

14: 1061. Lexicographically Smallest Equivalent String.py

15: 2421. Number of Good Paths.py

16: 57. Insert Interval.py

17: 926. Flip String to Monotone Increasing.py

18: 918. Maximum Sum Circular Subarray.py

19: 491. Non-decreasing Subsequences.py

20: 974. Subarray Sums Divisible by K.py

21: 93. Restore IP Addresses.py

22: 131. Palindrome Partitioning.py

23: 997. Find the Town Judge.py

24: 909. Snakes and Ladders.py

25: 2359. Find Closest Node to Given Two Nodes.py

26: 787. Cheapest Flights Within K Stops.py

27: 472. Concatenated Words.py

28: 352. Data Stream as Disjoint Intervals.py

29: 460. LFU Cache.py

30: 1137. N-th Tribonacci Number.py

31: 1626. Best Team With No Conflicts.py

Feb Challenge:

1: 1071. Greatest Common Divisor of Strings.py

2: 953. Verifying an Alien Dictionary.py

3: 6. Zigzag Conversion.py

4: 438. Find All Anagrams in a String.py

5: 1470. Shuffle the Array.py

6: 567. Permutation in String.py

7: 904. Fruit Into Baskets.py

8: 45. Jump Game II.py

9: 2306. Naming a Company.py

10: 1162. As Far from Land as Possible.py

11: 1129. Shortest Path with Alternating Colors.py

12: 2477. Minimum Fuel Cost to Report to the Capital.py

13: 1523. Count Odd Numbers in an Interval Range.py

14: 67. Add Binary.py

15: 989. Add to Array-Form of Integer.py

16: 104. Maximum Depth of Binary Tree.py

17: 783. Minimum Distance Between BST Nodes.py

18: 226. Invert Binary Tree.py

19: 103. Binary Tree Zigzag Level Order Traversal.py

20: 35. Search Insert Position.py

21: 540. Single Element in a Sorted Array.py

22: 1011. Capacity To Ship Packages Within D Days.py

23: 502. IPO.py

24: 1675. Minimize Deviation in Array.py

25: 121. Best Time to Buy and Sell Stock.py

26: 72. Edit Distance.py

27: 427. Construct Quad Tree.py

28: 652. Find Duplicate Subtrees.py

Mar Challenge:

1: 912. Sort an Array.py

2: 443. String Compression.py

3: 28. Find the Index of the First Occurrence in a String.py

4: 2444. Count Subarrays With Fixed Bounds.py

5: 1345. Jump Game IV.py

6: 1539. Kth Missing Positive Number.py

7: 2187. Minimum Time to Complete Trips.py

8: 875. Koko Eating Bananas.py

9: 142. Linked List Cycle II.py

10: 382. Linked List Random Node.py

11: 109. Convert Sorted List to Binary Search Tree.py

12: 23. Merge k Sorted Lists.py

13: 101. Symmetric Tree.py

14: 129. Sum Root to Leaf Numbers.py

15: 958. Check Completeness of a Binary Tree.py

16: 106. Construct Binary Tree from Inorder and Postorder Traversal.py

17: 208. Implement Trie (Prefix Tree).py

18: 1472. Design Browser History.py

19: 211. Design Add and Search Words Data Structure.py

20: 605. Can Place Flowers.py

21: 2348. Number of Zero-Filled Subarrays.py

22: 2492. Minimum Score of a Path Between Two Cities.py

23: 1319. Number of Operations to Make Network Connected.py

24: 1466. Reorder Routes to Make All Paths Lead to the City Zero.py

25: 2316. Count Unreachable Pairs of Nodes in an Undirected Graph.py

26: 2360. Longest Cycle in a Graph.py

27: 64. Minimum Path Sum.py

28: 983. Minimum Cost For Tickets.py

29: 1402. Reducing Dishes.py

30: 87. Scramble String.py

31: 1444. Number of Ways of Cutting a Pizza.py

Apr Challenge:

2: 2300. Successful Pairs of Spells and Potions.py

3: 881. Boats to Save People.py

4: 2405. Optimal Partition of String.py

5: 2439. Minimize Maximum of Array.py

6: 1254. Number of Closed Islands.py

7: 1020. Number of Enclaves.py

8: 133. Clone Graph.py

9: 1857. Largest Color Value in a Directed Graph.py

10: 20. Valid Parentheses.py

11: 2390. Removing Stars From a String.py

12: 71. Simplify Path.py

13: 946. Validate Stack Sequences.py

14: 516. Longest Palindromic Subsequence.py

15: 2218. Maximum Value of K Coins From Piles.py

16: 1639. Number of Ways to Form a Target String Given a Dictionary.py

17: 1431. Kids With the Greatest Number of Candies.py

18: 1768. Merge Strings Alternately.py

19: 1372. Longest ZigZag Path in a Binary Tree.py

20: 662. Maximum Width of Binary Tree.py

21: 879. Profitable Schemes.py

22: 1312. Minimum Insertion Steps to Make a String Palindrome.py

23: 1416. Restore The Array.py

24: 1046. Last Stone Weight.py

25: 2336. Smallest Number in Infinite Set.py

26: 258. Add Digits.py

27: 319. Bulb Switcher.py

28: 839. Similar String Groups.py

29: 1697. Checking Existence of Edge Length Limited Paths.py

30: 1579. Remove Max Number of Edges to Keep Graph Fully Traversable.py

1: 704. Binary Search.py

May Challenge:

1: 1491. Average Salary Excluding the Minimum and Maximum Salary.py

2: 1822. Sign of the Product of an Array.py

3: 2215. Find the Difference of Two Arrays.py

4: 649. Dota2 Senate.py

5: 1456. Maximum Number of Vowels in a Substring of Given Length.py

6: 1498. Number of Subsequences That Satisfy the Given Sum Condition.py

7: 1964. Find the Longest Valid Obstacle Course at Each Position.py

9: 54. Spiral Matrix.py

10: 59. Spiral Matrix II.py

11: 1035. Uncrossed Lines.py

12: 2140. Solving Questions With Brainpower.py

13: 2466. Count Ways To Build Good Strings.py

14: 1799. Maximize Score After N Operations.py

15: 1721. Swapping Nodes in a Linked List.py

16: 24. Swap Nodes in Pairs.py

17: 2130. Maximum Twin Sum of a Linked List.py

18: 1557. Minimum Number of Vertices to Reach All.py

19: 785. Is Graph Bipartite?.py

20: 399. Evaluate Division.py

21: 934. Shortest Bridge.py

22: 347. Top K Frequent Elements.py

23: 703. Kth Largest Element in a Stream.py

8: 1572. Matrix Diagonal Sum.py

24: 2542. Maximum Subsequence Score.py

25: 837. New 21 Game.py

26: 1140. Stone Game II.py

27: 1406. Stone Game III.py

28: 1406. Stone Game III.py

29: 1547. Minimum Cost to Cut a Stick.py

30: 1603. Design Parking System.py

31: 705. Design HashSet.py

32: 1396. Design Underground System.py

Jun Challenge:

1: 1091. Shortest Path in Binary Matrix.py

2: 2101. Detonate the Maximum Bombs.py

3: 1376. Time Needed to Inform All Employees.py

4: 547. Number of Provinces.py

5: 1232. Check If It Is a Straight Line.py

6: 1502. Can Make Arithmetic Progression From Sequence.py

7: 1318. Minimum Flips to Make a OR b Equal to c.py

8: 1351. Count Negative Numbers in a Sorted Matrix.py

9: 744. Find Smallest Letter Greater Than Target.py

10: 1802. Maximum Value at a Given Index in a Bounded Array.py

11: 1146. Snapshot Array.py

12: 228. Summary Ranges.py

13: 2352. Equal Row and Column Pairs.py

14: 530. Minimum Absolute Difference in BST.py

15: 1161. Maximum Level Sum of a Binary Tree.py

16: 1569. Number of Ways to Reorder Array to Get Same BST.py

17: 1187. Make Array Strictly Increasing.py

18: 2328. Number of Increasing Paths in a Grid.py

19: 1732. Find the Highest Altitude.py

20: 2090. K Radius Subarray Averages.py

21: 2448. Minimum Cost to Make Array Equal.py

22: 714. Best Time to Buy and Sell Stock with Transaction Fee.py

23: 1027. Longest Arithmetic Subsequence.py

24: 956. Tallest Billboard.py

25: 1575. Count All Possible Routes.py

26: 2462. Total Cost to Hire K Workers.py

27: 373. Find K Pairs with Smallest Sums.py

28: 1514. Path with Maximum Probability.py

29: 864. Shortest Path to Get All Keys.py

30: 1970. Last Day Where You Can Still Cross.py

Jul Challenge:

1: 2305. Fair Distribution of Cookies.py

2: 1601. Maximum Number of Achievable Transfer Requests.py

3: 859. Buddy Strings.py

4: 137. Single Number II.py

5: 1493. Longest Subarray of 1's After Deleting One Element.py

6: 209. Minimum Size Subarray Sum.py

7: 2024. Maximize the Confusion of an Exam.py

8: 2551. Put Marbles in Bags.py

9: 2272. Substring With Largest Variance.py

10: 111. Minimum Depth of Binary Tree.py

11: 863. All Nodes Distance K in Binary Tree.py

12: 802. Find Eventual Safe States.py

13: 207. Course Schedule.py

14: 1218. Longest Arithmetic Subsequence of Given Difference.py

15: 1751. Maximum Number of Events That Can Be Attended II.py

16: 1125. Smallest Sufficient Team.py

17: 445. Add Two Numbers II.py

18: 146. LRU Cache.py

19: 435. Non-overlapping Intervals.py

20: 735. Asteroid Collision.py

21: 673. Number of Longest Increasing Subsequence.py

22: 688. Knight Probability in Chessboard.py

23: 894. All Possible Full Binary Trees.py

24: 50. Pow(x, n).py

25: 852. Peak Index in a Mountain Array.py

26: 1870. Minimum Speed to Arrive on Time.py

27: 2141. Maximum Running Time of N Computers.py

28: 486. Predict the Winner.py

29: 808. Soup Servings.py

30: 664. Strange Printer.py

31: 712. Minimum ASCII Delete Sum for Two Strings.py

Aug Challenge:

1: 77. Combinations.py

2: 46. Permutations.py

3: 17. Letter Combinations of a Phone Number.py

4: 139. Word Break.py

5: 95. Unique Binary Search Trees II.py

6: 920. Number of Music Playlists.py

7: 74. Search a 2D Matrix.py

8: 33. Search in Rotated Sorted Array.py

9: 2616. Minimize the Maximum Difference of Pairs.py

10: 81. Search in Rotated Sorted Array II.py

11: 518. Coin Change II.py

12: 63. Unique Paths II.py

13: 2369. Check if There is a Valid Partition For The Array.py

14: 215. Kth Largest Element in an Array.py