Given an array of integers, return indices of the two numbers such that they add up to a specific target.
Input: nums = [2, 7, 11, 15], target = 9Implement a binary search algorithm to find the index of a target value in a sorted array.
Input: nums = [1, 2, 3, 4, 5], target = 3Given a collection of intervals, merge all overlapping intervals.
Input: intervals = [[1,3],[2,6],[8,10],[15,18]]Determine if two strings are anagrams of each other.
Input: s = "anagram", t = "nagaram"Implement a first in first out (FIFO) queue using two stacks.
Input: push(1), push(2), pop(), peek()Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.
Input: s = "({[]})"Implement a queue using two stacks.
Input: enqueue(1), enqueue(2), dequeue()Reverse a singly linked list.
Input: head = [1,2,3,4,5]Find the lowest common ancestor (LCA) of two given nodes in a binary tree.
Input: root = [3,5,1,6,2,0,8], p = 5, q = 1Perform an inorder traversal of a binary tree.
Input: root = [1,null,2,3]Given an array of integers, return indices of the two numbers such that they add up to a specific target.
Input: nums = [2, 7, 11, 15], target = 9Implement a binary search algorithm to find the index of a target value in a sorted array.
Input: nums = [1, 2, 3, 4, 5], target = 3Given a collection of intervals, merge all overlapping intervals.
Input: intervals = [[1,3],[2,6],[8,10],[15,18]]Determine if two strings are anagrams of each other.
Input: s = "anagram", t = "nagaram"Implement a first in first out (FIFO) queue using two stacks.
Input: push(1), push(2), pop(), peek()Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.
Input: s = "({[]})"Implement a queue using two stacks.
Input: enqueue(1), enqueue(2), dequeue()Reverse a singly linked list.
Input: head = [1,2,3,4,5]Find the lowest common ancestor (LCA) of two given nodes in a binary tree.
Input: root = [3,5,1,6,2,0,8], p = 5, q = 1Perform an inorder traversal of a binary tree.
Input: root = [1,null,2,3]Given an integer array, find if the array contains any duplicates.
Input: nums = [1,2,3,1]Given an array nums of n integers where n > 1, return an array output such that output[i] is equal to the product of all the elements of nums except nums[i].
Input: nums = [1,2,3,4]Find the contiguous subarray (containing at least one number) which has the largest sum and return its sum.
Input: nums = [-2,1,-3,4,-1,2,1,-5,4]Rotate the array to the right by k steps, where k is non-negative.
Input: nums = [1,2,3,4,5,6,7], k = 3Find the contiguous subarray within an array (containing at least one number) which has the largest product.
Input: nums = [2,3,-2,4]Given a string, find the length of the longest substring without repeating characters.
Input: s = "abcabcbb"Given a string s, return the longest palindromic substring in s.
Input: s = "babad"Given an array of strings, group the anagrams together.
Input: strs = ["eat","tea","tan","ate","nat","bat"]Given a string s, return the longest palindromic substring in s.
Input: s = "babad"Implement strStr() to find the first occurrence of a substring in a string.
Input: haystack = "hello", needle = "ll"Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.
Input: push(-2), push(0), push(-3), getMin(), pop(), top(), getMin()Evaluate the value of an arithmetic expression in Reverse Polish Notation.
Input: tokens = ["2","1","+","3","*"]Given an array of integers temperatures representing the daily temperatures, return an array such that answer[i] is the number of days you have to wait until a warmer temperature.
Input: temperatures = [73,74,75,71,69,72,76,73]Implement a stack using only two queues.
Input: push(1), push(2), top(), pop(), top()Given an array nums and a sliding window size k, return the maximum value in each window.
Input: nums = [1,3,-1,-3,5,3,6,7], k = 3Merge two sorted linked lists and return it as a new sorted list.
Input: l1 = [1,2,4], l2 = [1,3,4]Given a linked list, remove the n-th node from the end of the list.
Input: head = [1,2,3,4,5], n = 2Determine if a linked list has a cycle in it.
Input: head = [3,2,0,-4], pos = 1Given a linked list, reverse the nodes of a linked list k at a time and return its modified list.
Input: head = [1,2,3,4,5], k = 2Given a binary tree, return the inorder traversal of its nodes' values.
Input: root = [1,null,2,3]Given a binary tree, check whether it is a mirror of itself (symmetric around its center).
Input: root = [1,2,2,3,4,4,3]Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.
Input: root = [5,4,8,11,null,13,4], sum = 22Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST.
Input: root = [6,2,8,0,4,7,9], p = 2, q = 8Return the level order traversal of its nodes' values.
Input: root = [3,9,20,null,null,15,7]