A stack is a data structure that supports push, pop, and min operations in constant time.
The Fibonacci sequence is a series of numbers in which each number is the sum of the two preceding numbers. The first two numbers in the sequence are 1 and 1, and the third number is 2. The fourth number is 3, the fifth number is 5, and so on. The function takes in a number n and prints out the first n numbers of the Fibonacci sequence .
Given an array of positive integers and a positive integer s, this function returns the minimal length of a contiguous subarray of which the sum is greater than or equal to s. If there isn 't one, it returns 0 instead.
Find the minimum path sum in a 2D array from the top-left corner to the bottom-right corner.
Given an array of n integers, find the contiguous subarray of given length k that has the maximum average value. Output the maximum average value.
Given a binary tree, this function checks whether it is symmetrical around its center. For example, the first tree in the input is symmetrical, but the second one is not.
Given a list of integers and a target sum, return the indices of the two numbers that add up to the target sum.
This technical problem deals with determining whether or not a given string consisting of only brackets is valid. A string is considered valid if the open brackets are closed by the same type of brackets in the correct order. An empty string is also considered valid.