# Bloomberg

## Min Stack LeetCode Solution

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

## Pow(x n) LeetCode Solution

Implement pow(x, n), which calculates x raised to the power n.

## Group Anagrams LeetCode Solution

Given an array of strings strs, group the anagrams together. You can return the answer in any order.

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

## Swap Nodes in Pairs LeetCode Solution

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.

## Search in Rotated Sorted Array LeetCode Solution

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.

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

## Intersection of Two Linked Lists LeetCode Solution

Given the heads of two singly linked-lists headA and headB, return the node at which the two lists intersect. If the two linked lists have no intersection at all, return null.

## Longest Palindromic Substring LeetCode Solution

Given a string s, return the longest palindromic substring in s. A palindrome is a string which reads the same in both directions. For example, S = “aba” is a palindrome, S = “abc” is not.

## 3Sum LeetCode Solution

Given an integer array nums, return all the triplets [nums[i], nums[j], nums[k]] such that i != j, i != k, and j != k, and nums[i] + nums[j] + nums[k] == 0.

## Longest Substring Without Repeating Characters LeetCode Solution

Given a string s, find the length of the longest substring without repeating characters.

## Add Two Numbers LeetCode Solution

You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order, and each of their nodes contains a single digit. Add the two numbers and return the sum as a linked list.

## Two Sum LeetCode Solution

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.

## Remove Duplicates from Sorted Array LeetCode Solution

Given an integer array nums sorted in non-decreasing order, remove the duplicates in-place such that each unique element appears only once. The relative order of the elements should be kept the same.

Scroll to Top