Skip to content

πŸ“ A collection of LeetCode problems I’ve solved. πŸ’‘ Solutions with explanations to understand the approach. πŸš€ Organized by difficulty and problem type. 🎯 Practicing daily to get better at algorithms and data structures. πŸ”— Feel free to explore, learn, and suggest improvements!

Notifications You must be signed in to change notification settings

MahadevaPrasadMCS/Leetcode-Problem-Solving

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

24 Commits
Β 
Β 
Β 
Β 

Repository files navigation

Leetcode-Problem-Solving

πŸ“ A collection of LeetCode problems I’ve solved. πŸ’‘ Solutions with explanations to understand the approach. πŸš€ Organized by difficulty and problem type. 🎯 Practicing daily to get better at algorithms and data structures. πŸ”— Feel free to explore, learn, and suggest improvements!

Day 1

  • Solved LeetCode Problem 15: 3Sum
  • Approach: Two-pointer technique
  • Handled edge cases:
    • Array/List size less than 3
    • Duplicate elements

Day 2

  • Solved LeetCode Problem 16: 3Sumclosest
  • Approach: Two-pointer technique
  • Handled edge cases:
    • Array/List size less than 3
    • Duplicate elements
    • Updating the closest_sum when there is a best difference.

Day 3

  • Solved LeetCode Problem 18: 4Sum
  • Approach: Two-pointer technique
  • Handled edge cases:
    • Array/List size less than 4
    • Duplicate elements
    • Updating the two pointers and storing valid quadruplets.

Day 4

  • Solved LeetCode Problem 11: Container with most water
  • Approach: Two pointer approach
  • Handled edge cases:
    • Computing max_area based on minimum height from the left or right.
    • Updating the two pointers and storing valid max_area.

Day 5

  • Solved LeetCode Problem 31: Finding the next permutation
  • Approach: Two pointers and swapping
  • Handled edge cases:
    • Finding first drop in the list.
    • Swapping the elements.
    • Reversing the right part of list.

Day 6

  • Solved LeetCode Problem 35: Search insert position
  • Approach: Binary Search
  • Handled edge cases:
    • Finding the element based mid value.
    • The last value of left index the expected index.

Day 7

  • Solved LeetCode Problem 3: Finding longest substring without repeating character
  • Approach: Sliding Window
  • Handled edge cases:
    • Finding the longest substring using sliding window and HashTable.
    • The shrinking or expandng window using two pointers.

Day 8

  • Solved LeetCode Problem 49: Finding anagrams
  • Approach: Sorting and Hashtable(dictionary)
  • Handled edge cases:
    • Using a defaultdict() from collections to create a dictionary of values stored as list.
    • Finding the key for dictionary using join() and sorted() methods.
    • Returning the list of values.

Day 9

  • Solved LeetCode Problem 33: Searching in sorted and rotated array
  • Approach: Binary search
  • Handled edge cases:
    • Finding which half is sorted.
    • Finding which pointer to move(left or move).
    • Returning -1 if the element is not found.

About

πŸ“ A collection of LeetCode problems I’ve solved. πŸ’‘ Solutions with explanations to understand the approach. πŸš€ Organized by difficulty and problem type. 🎯 Practicing daily to get better at algorithms and data structures. πŸ”— Feel free to explore, learn, and suggest improvements!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages