# Amazon

## Group Anagrams LeetCode Solution

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

## Rotate Image LeetCode Solution

You are given an n x n 2D matrix representing an image, rotate the image by 90 degrees (clockwise).

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

## Merge Two Sorted Lists LeetCode Solution

You are given the heads of two sorted linked lists list1 and list2. Merge the two lists in a one sorted list. The list should be made by splicing together the nodes of the first two lists. Return the head of the merged linked list.

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