About 58 results
Open links in new tab
  1. Python Logic of ListNode in Leetcode - Stack Overflow

    Python Logic of ListNode in Leetcode Asked 6 years, 8 months ago Modified 4 years, 8 months ago Viewed 116k times

  2. python - LeetCode 2. Add Two Numbers - Code Review Stack Exchange

    Dec 12, 2025 · LeetCode's data structures LeetCode's linked list data structure is dumb. It doesn't do nice things like let you iterate over it using built-in functionality in Python. But you don't have to live …

  3. python - LeetCode - 2. Add Two Numbers - Stack Overflow

    Dec 13, 2023 · I'm attempting to address Leetcode problem 2. Add Two Numbers: You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order, …

  4. python - Optimizing LeetCode's "Minimum Pair Removal to Sort Array …

    Apr 6, 2025 · I am working on the LeetCode problem 3510. Minimum Pair Removal to Sort Array II: Given an array nums, perform the following operation any number of times: Select the adjacent pair …

  5. how does python functions inside 'Class Solution' get called ...

    May 12, 2024 · in leetcode python problems, we have the following structure-- Class Solution: def function(): {some code here} i completed the function of the specific problem but i didn't call the func...

  6. How can i improve my python code of leetcode problem 345 and how …

    Mar 9, 2025 · How can i improve my python code of leetcode problem 345 and how i can i improve the time complexity [closed] Asked 9 months ago Modified 9 months ago Viewed 149 times

  7. python - Leetcode 3sum problem solution - Code Review Stack Exchange

    Mar 3, 2024 · I'm surprised no one on Leetcode mentioned: Assuming you are working with integers within a fixed range [-N,N], CLRS gives a O (n + N log N) solution for 3SUM. Represent nums as a …

  8. python - Why does this greedy algorithm work for "Lexicographically ...

    Mar 26, 2025 · I am looking at solutions to the LeetCode problem 3474. Lexicographically Smallest Generated String: You are given two strings, str1 and str2, of lengths n and m, respectively. A string …

  9. python - Mathematical explanation of Leetcode question: Container …

    Apr 30, 2022 · I was working on a medium level leetcode question 11. Container With Most Water. Besides the brute force solution with O(n^2), there is an optimal solution with complexity of O(n) by …

  10. python - Question about leetcode 217: Contains Duplicate - Stack …

    Oct 14, 2021 · I'm doing the leetcode question #217 : Contains Duplicate. After checking the answer, I cannot understand some parts of the code. The question is as given below: Given an integer array …