哩扣寶寶船

@leetcode-baby-ship

Public team

Community (0)
No community contribution yet

Joined on Apr 26, 2022

  • Problem You are given the heads of two sorted linked lists list1 and list2. Merge the two lists in a one sorted list. The list should be made by splicing together the nodes of the first two lists. Return the head of the merged linked list. Sample Input & Output example 1
     Like  Bookmark
  • Problem You're given two Linked Lists of potentially unequal length. These Linked Lists potentially merge at a shared intersection node. Write a function that returns the intersection node or returns None / null if there is no intersection. Each LinkedList node has an integer value as well as a next node pointing to the next node in the list or to None null if it's the tail of the list. Note: Your function should return an existing node. It should not modify either Linked List, and it should not create any new Linked Lists. Sample Input linkedListOne = 2 -> 3 -> 1 -> 4 linkedListTwo = 8 -> 7 -> 1 -> 4 Sample Output // The lists intersect at the node with value 1
     Like  Bookmark
  • Problem Write a function that takes in the head of a Singly Linked List and an integer k and removes the kth node ==from the end of the list==. The removal should be done in place, meaning that the original data structure should be mutated (no new structure should be created). Furthermore, the input head of the linked list should remain the head of the linked list after the removal is done, even if the head is the node that's supposed to be removed. In other words, if the head is the node that's supposed to be removed, your function should simply mutate its value and next pointer. Note that your function doesn't need to return anything. You can assume that the input Linked List will always have at least two nodes and, more specifically, at least k nodes. Each LinkedList node has an integer value as well as a next node pointing to the next node in the list or to None / null if it's the tail of the list. Sample Input head = 0 -> 1 -> 2 -> 3 -> 4 -> 5 -> 6 -> 7 -> 8 -> 9 // the head node with value 0
     Like  Bookmark
  • 121. Best Time to Buy and Sell Stock :::spoiler Optimal Space & Time Complexity - Time complexity: - Space complexity: ::: Solutions :::spoiler 東
     Like  Bookmark
  • 11. Container With Most Water https://leetcode.com/problems/container-with-most-water/description/ :::spoiler Optimal Space & Time Complexity - Time complexity: O(n) - Space complexity: O(1) ::: Solutions
     Like  Bookmark
  • 15. 3Sum https://leetcode.com/problems/3sum/description/ :::spoiler Optimal Space & Time Complexity - Time complexity: O(n^2) - Space complexity: O(1) ::: Solutions
     Like  Bookmark
  • Problem https://leetcode.com/contest/weekly-contest-356/problems/shortest-string-that-contains-three-strings/ :::spoiler Optimal Space & Time Complexity - Time complexity: - Space complexity: :::
     Like  Bookmark
  • Problem https://leetcode.com/problems/count-complete-subarrays-in-an-array/ :::spoiler Optimal Space & Time Complexity - Time complexity: O(n) - Space complexity: O(n) ::: Solutions
     Like  Bookmark
  • Problem https://leetcode.com/problems/visit-array-positions-to-maximize-score/description/ :::spoiler Optimal Space & Time Complexity - Time complexity: - Space complexity: ::: Solutions
     Like  Bookmark
  • Problem https://leetcode.com/problems/sort-vowels-in-a-string/description/ :::spoiler Optimal Space & Time Complexity - Time complexity: O(nlogn) where n is string.length because of sorting - Space complexity: O(n) where n is string.length :::
     Like  Bookmark
  • Leetcode刷題學習筆記 – Line Sweep [翻譯]掃描線算法(Line Sweep Algorithm)(1)
     Like  Bookmark
  • Problem https://leetcode.com/problems/maximum-beauty-of-an-array-after-applying-operation/description/ :::spoiler Optimal Space & Time Complexity - Time complexity: - Space complexity: ::: Solutions
     Like  Bookmark
  • Problem https://leetcode.com/problems/sum-of-squares-of-special-elements/description/ :::spoiler Optimal Space & Time Complexity - Time complexity: O(squr(n)) - Space complexity: O(n) ::: Solutions
     Like  Bookmark
  • Problem 155. Min Stack Write a MinMaxStack class for a Min Max Stack. The class should support: Pushing and popping values on and off the stack. Peeking at the value at the top of the stack. Getting both the minimum and the maximum values in the stack at any given point in time. :::warning
     Like  Bookmark
  • Problem https://leetcode.com/problems/minimum-index-of-a-valid-split/description/ :::spoiler Optimal Space & Time Complexity - Time complexity: O(n) where n is arr.length - Space complexity: O(1) ::: Solutions
     Like  Bookmark
  • Problem https://leetcode.com/problems/valid-palindrome/ :::spoiler Optimal Space & Time Complexity ::: Solutions :::spoiler 東
     Like  Bookmark
  • Problem :::spoiler Optimal Space & Time Complexity ::: Solutions :::spoiler 東 :::
     Like  Bookmark
  • tags: Problem Sample Input Sample Output :::spoiler Optimal Space & Time Complexity :::
     Like  Bookmark
  • Problem You're given a Node class that has a name and an array of optional children nodes. When put together, nodes form an acyclic tree-like structure. Implement the breadthFirstSearch method on the Node class, which takes in an empty array, traverses the tree using the Breadth-first-Search approach (specifically navigating the tree from left to right), stores all of the nodes' names in the input array, and returns it. If you're unfamiliar with Breadth-first Search, we recommend watching the Conceptual Overview section of this question's video explanation before starting to code. Sample Input graph = A / | \ B C D / \ / \
     Like  Bookmark
  • Problem You're given an array of integers where each integer represents a jump of its value in the array. For instance, the integer 2 represents a jump of two indices forward in the array; the integer -3 represents a jump of three indices backward in the array. If a jump spills past the array's bounds, it wraps over to the other side. For instance, a jump of -1 at index 0 brings us to the last index in the array. Similarly, a jump of 1 at the last index in the array brings us to index 0. Write a function that returns a boolean representing whether the jumps in the array form a single cycle. A single cycle occurs if, starting at any index in the array and following the jumps, every element in the array is visited exactly once before landing back on the starting index. Sample Input array = [2, 3, 1, -4, -4, 2] Sample Output
     Like  Bookmark