Given the head
of a linked list, return the node where the cycle begins. If there is no cycle, return null
.
- Nov 09 Wed 2022 18:42
[LeetCode] 142. Linked List Cycle II
- Nov 09 Wed 2022 15:53
[LeetCode] 141. Linked List Cycle
Given head
, the head of a linked list, determine if the linked list has a cycle in it.
- Nov 08 Tue 2022 16:20
[LeetCode] 160. Intersection of Two Linked Lists
160. Intersection of Two Linked Lists
Given the heads of two singly linked-lists headA
and headB
, return the node at which the two lists intersect. If the two linked lists have no intersection at all, return null
.
- Nov 07 Mon 2022 00:05
[LeetCode] 876. Middle of the Linked List
876. Middle of the Linked List
Given the head
of a singly linked list, return the middle node of the linked list.
- Nov 06 Sun 2022 15:01
[LeetCode] 206. Reverse Linked List
Given the head
of a singly linked list, reverse the list, and return the reversed list.
- Nov 04 Fri 2022 16:42
[LeetCode] 21. Merge Two Sorted Lists
You are given the heads of two sorted linked lists list1
and list2
.
- Oct 28 Fri 2022 20:54
[LeetCode] 33. Search in Rotated Sorted Array
There is an integer array nums
sorted in ascending order (with distinct values).
Prior to being passed to your function, nums
is possibly rotated at an unknown pivot index k
(1 <= k < nums.length
) such that the resulting array is [nums[k], nums[k+1], ..., nums[n-1], nums[0], nums[1], ..., nums[k-1]]
(0-indexed). For example, [0,1,2,4,5,6,7]
might be rotated at pivot index 3
and become [4,5,6,7,0,1,2]
.
- Oct 26 Wed 2022 12:36
[LeetCode] 540. Single Element in a Sorted Array
You are given a sorted array consisting of only integers where every element appears exactly twice, except for one element which appears exactly once.
Return the single element that appears only once.
- Oct 24 Mon 2022 11:06
[LeetCode] 34. Find First and Last Position of Element in Sorted Array
Given an array of integers nums
sorted in non-decreasing order, find the starting and ending position of a given target
value.
If target
is not found in the array, return [-1, -1]
.
- Oct 21 Fri 2022 21:48
[LeetCode] 278. First Bad Version
You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the quality check. Since each version is developed based on the previous version, all the versions after a bad version are also bad.
Suppose you have n
versions [1, 2, ..., n]
and you want to find out the first bad one, which causes all the following ones to be bad.