Medium
Solutions and thought process for medium difficulty Leetcode problems.
19. Remove Nth Node From End of List
Given the head of a linked list, remove the nth node from the end of the list and return its head.
143. Reorder List
You are given the head of a singly linked-list. The list can be represented as:
981. Time Based Key
Design a time-based key-value data structure that can store multiple values for the same key at different time stamps and retrieve the key's value at a certain timestamp.
33. Search in Rotated Sorted Array
There is an integer array nums sorted in ascending order (with distinct values).
74. Search a 2D Matrix
You are given an m x n integer matrix matrix with the following two properties:
167. Two Sum II
Given a 1-indexed array of integers numbers that is already sorted in non-decreasing order, find two numbers such that they add up to a specific target number. Let these two numbers be numbers[index1] and numbers[index2] where 1 <= index1 < index2 <= numbers.length.
238. Product of Array Except Self
Given an integer array nums, return an array answer such that answer[i] is equal to the product of all the elements of nums except nums[i].
347. Top K Frequent Elements
Given an integer array nums and an integer k, return the k most frequent elements. You may return the answer in any order.
36. Valid Sudoku
Determine if a 9 x 9 Sudoku board is valid. Only the filled cells need to be validated according to the following rules: