LeetCode 206: Reverse Linked List
Reverse a singly linked list.Hint: A linked list can be reversed either iteratively or recursively. Could you implement both?
Reverse a singly linked list.Hint: A linked list can be reversed either iteratively or recursively. Could you implement both?
Given an array of integers, every element appears twice except for one. Find that single one.
Given an integer array of size n, find all elements that appear more than ⌊ n/3 ⌋ times. The algorithm should run in linear time and in O(1) space.
Given an array of size n, find the majority element. The majority element is the element that appears more than n/2
times.
Given an array of n integers where n > 1, nums, return an array output such that output[i] is equal to the product of all the elements of nums except nums[i].