Given an array nums and a value val, remove all instances of that value in-place and return the new length. Do not allocate extra space…
Given a sorted array nums, remove the duplicates in-place such that each element appear only once and return the new length. Do not allocate extra…
Given a linked list, swap every two adjacent nodes and return its head. You may not modify the values in the list's nodes,…
Merge two sorted linked lists and return it as a new sorted list. The new list should be made by splicing together…
Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. An input string is valid if:…
Given a linked list, remove the n-th node from the end of list and return its head. Example: Given linked list:…
Given an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all unique triplets in the array which gives the sum of…
Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. Example 1:…
There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall…
Given a string, find the length of the longest substring without repeating characters. Example 1: Input: "abcabcbb" Output: 3 Explanation: The answer…
This website uses cookies.