#pythonDSA içeren gönderiler

#pythonDSA

X'te #pythonDSA kullanan herkese açık gönderiler.

İlgili etiketler

  1. Bhumi Pandey@BhumiPandey06
    LeetCode 1283 – Find the Smallest Divisor Given a Threshold Find the smallest divisor so that sum of [num/div]≤threshold Used binary search on divisor range[1…max(nums)] For each mid, compute sum If sum-threshold:increase divisor Else:shrink search space #LeetCode #PythonDSA
    00739
  2. Bhumi Pandey@BhumiPandey06
    LeetCode 557 – Reverse Words in a String III Solved: Reverse each word in the string, keep word order Split → reverse each → join Clean string + array manipulation in Python! Great practice for string traversal & logic! #LeetCode #PythonDSA #StringProblems
    00639
  3. Bhumi Pandey@BhumiPandey06
    LeetCode 54 – Spiral Matrix Solved: Return all elements of a matrix in spiral order Used boundaries: top, bottom, left, right Moved layer by layer inward while collecting elements Great for mastering 2D traversal logic! #100DaysOfCode #LeetCode #PythonDSA #MatrixProblems
    5018372
  4. Bhumi Pandey@BhumiPandey06
    LeetCode 796 – Rotate String Solved: Check if one string is rotation of another Trick: s2 must be a substring of s1 + s1 Simple check with in operator O(n²) worst-case, O(1) extra space Neat and elegant string trick! #LeetCode #100DaysOfCode #PythonDSA #Strings #DSA
    00534
  5. Bhumi Pandey@BhumiPandey06
    LeetCode 125 – Valid Palindrome Solved: Check if a string is a valid palindrome (ignore cases & non-alphanumerics) Cleaned string using regex + .lower() Two-pointer check from both ends Classic string + pointer logic! #LeetCode #PythonDSA #StringProblems #DSA
    00418
  6. Bhumi Pandey@BhumiPandey06
    LeetCode 219 – Contains Duplicate II Solved: Check if duplicate exists within k distance Used a hashmap to store last seen index Compared i - prev_index <= k for match Perfect use of sliding window + hashing combo! #LeetCode #PythonDSA #HashMapLogic
    00756
  7. Bhumi Pandey@BhumiPandey06
    LeetCode 118 – Pascal’s Triangle Solved: Generate Pascal’s Triangle up to numRows Built each row from the previous using simple math Classic pattern-building problem — clean & recursive! Loved the structure & symmetry! #LeetCode #PythonDSA #Patterns
    00449
  8. Bhumi Pandey@BhumiPandey06
    LeetCode 706 – Design HashMap Solved: Implement a basic HashMap from scratch Used array of buckets + handled collisions with chaining (lists) Implemented put(), get(), and remove() Great practice for building core data structures! #LeetCode #PythonDSA #basics
    00439
  9. Bhumi Pandey@BhumiPandey06
    LeetCode 49 – Group Anagrams Solved: Group strings that are anagrams of each other Used hashmap with sorted string as key Collected anagrams into lists based on character signature. Great use of hashmaps + sorting combo! #LeetCode #PythonDSA #HashMap #LearnInPublic
    00430
  10. Bhumi Pandey@BhumiPandey06
    LeetCode 66 – Plus One Solved: Increment the integer represented by an array Handled carryover from 9s (e.g., [9,9] → [1,0,0]) Used simple reverse traversal + carry logic. Great for building array + carry intuition. #LeetCode #PythonDSA #LearnInPublic
    00325
  11. Bhumi Pandey@BhumiPandey06
    LeetCode 81 – Search in Rotated Sorted Array II Solved: Like LC33 but with duplicates Modified Binary Search Skip duplicates if nums[left] == nums[mid] == nums[right] Still O(log n) in best case, O(n) worst case due to duplicates #LeetCode #100DaysOfCode #PythonDSA #BinarySearch
    00551
  12. Bhumi Pandey@BhumiPandey06
    LeetCode 53 – Maximum Subarray Solved: Find the subarray with the maximum sum Applied Kadane’s Algorithm Track running sum, reset if it drops below 0 Time: O(n), Space: O(1) Perfect to build prefix thinking & subarray mastery! #PythonDSA #LeetCode #Kadane #LearnInPublic
    10423
  13. Bhumi Pandey@BhumiPandey06
    LeetCode 209 – Minimum Size Subarray Sum Solved: Find the smallest subarray with sum ≥ target Used sliding window to expand & shrink range dynamically Time: O(n), Space: O(1) Solid practice for mastering window-based optimization! #LeetCode #PythonDSA #SlidingWindow
    00880
  14. Bhumi Pandey@BhumiPandey06
    LeetCode 705 – Design HashSet Solved: Build a basic HashSet from scratch Implemented with a list of buckets (chaining method) Covered add(), remove(), contains() Solid intro to DS design & hashing logic #LeetCode #DataStructures #PythonDSA #HashSet
    10464
  15. Bhumi Pandey@BhumiPandey06
    LeetCode 151 – Reverse Words Task: Reverse the order of words, not characters. Input: " hello world " → Output: "world hello" Used: split(), reverse(), join() Focus: Clean strings, trim spaces, reverse logic. #LeetCode #PythonDSA #StringManipulation #LearnInPublic
    00424
  16. Bhumi Pandey@BhumiPandey06
    LeetCode 941 – Valid Mountain Array Solved: Check if the array forms a valid mountain shape Strictly increasing, then strictly decreasing Used two-pointer climb + descent logic Edge cases = key here Great mix of condition checks & pointer flow! #LeetCode #PythonDSA #ArrayProblems
    00430
  17. Bhumi Pandey@BhumiPandey06
    LeetCode 1089 – Duplicate Zeros Solved: Duplicate each zero in the array in-place, shifting elements right Used two passes: Count how many zeros can be duplicated Fill from the back using reverse two-pointer Great for tricky in-place logic! #LeetCode #PythonDSA #ArrayProblems
    009159
  18. Bhumi Pandey@BhumiPandey06
    LeetCode 414 – Third Maximum Number Solved: Find the 3rd distinct max number in the array Used a set to track unique values Handled edge case: return max if < 3 distinct numbers Cleans up logic around max tracking & uniqueness! #LeetCode #PythonDSA #ArrayProblems
    00428
  19. Daha fazla gönderi göster