Min Stack LeetCode Solution
Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.
Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.
Given an array of strings strs, group the anagrams together. You can return the answer in any order.
Given an array of distinct integers candidates and a target integer target, return a list of all unique combinations of candidates where the chosen numbers sum to target. You may return the combinations in any order.
Given a linked list, swap every two adjacent nodes and return its head. You must solve the problem without modifying the values in the list’s nodes.
Write a program to solve a Sudoku puzzle by filling the empty cells.
Given the array nums after the possible rotation and an integer target, return the index of target if it is in nums, or -1 if it is not in nums.
Given the head of a singly linked list, reverse the list, and return the reversed list.
Given an input string s and a pattern p, implement regular expression matching with support for ‘.’ and ‘*’ where ‘.’ Matches any single character and ‘*’ Matches zero or more of the preceding element.
You are given an array of k linked-lists lists, each linked-list is sorted in ascending order. Merge all the linked-lists into one sorted linked-list and return it.
Write an algorithm to determine if a number n is happy. Return true if n is a happy number, and false if not.
Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. You may assume that each input would have exactly one solution, and you may not use the same element twice.