# Zenefits

## Min Stack LeetCode Solution

Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.

## Trapping Rain Water LeetCode Solution

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.

## Reverse Linked List LeetCode Solution

Given the head of a singly linked list, reverse the list, and return the reversed list.

## Valid Parentheses LeetCode Solution

Given a string s containing just the characters ‘(‘, ‘)’, ‘{‘, ‘}’, ‘[‘ and ‘]’, determine if the input string is valid.

## Convert Sorted List to Binary Search Tree LeetCode Solution

Given the head of a singly linked list where elements are sorted in ascending order, convert it to a  height-balanced binary search tree.

## Majority Element LeetCode Solution

Given an array nums of size n, return the majority element. The majority element is the element that appears more than [n / 2] times. You may assume that the majority element always exists in the array.

## Median of Two Sorted Arrays LeetCode Solution

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)).

Scroll to Top