Given n non-negative integers a1, a2, …, an , where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0). Find two lines, which together with x-axis forms a container, such that the container contains the most water.
A robot is located at the top-left corner of a m x n grid (marked ‘Start’ in the diagram below).
Given an array of strings, group anagrams together.
You are given an n x n 2D matrix representing an image.
Rotate the image by 90 degrees (clockwise).
Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum.