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.
Implement pow(x, n), which calculates x raised to the power n.
Given an input string (s) and a pattern (p), implement wildcard pattern matching with support for ‘?’ and ‘*’ where: ‘?’ Matches any single character.’*’ Matches any sequence of characters (including the empty sequence).The matching should cover the entire input string.
Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it can trap after raining.
Given an array of integers nums, find the next permutation of nums.
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.
Given a string s containing just the characters ‘(‘, ‘)’, ‘{‘, ‘}’, ‘[‘ and ‘]’, determine if the input string is valid.
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.
Given an m x n board of characters and a list of strings words, return all words on the board.
Given two sorted arrays nums1 and nums2 of size m and n respectively, return the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).