# Tag: array

## Leetcode Problem 32: Trapping Rain Water in go

Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining. Example: Input: [0,1,0,2,1,0,1,3,2,1,2,1] Output: 6… Read more »

## Go Slices Demystified

Slices are one of those types in Go that take a little bit of time and hands-on experience to really wrap your head around. There is a lot of material… Read more »

## A maximal subarray

The input is an array of numbers, e.g. The task is: find the contiguous subarray of arr with the maximal sum of items. Write the function getMaxSubSum(arr) that will return that sum. For instance:… Read more »

## Given an array of integers, return a new array where each element in the new array is the number of smaller elements to the right of that element in the original input array.

This problem was asked by Google. Given an array of integers, return a new array where each element in the new array is the number of smaller elements to the… Read more »

## pair of elements in an array having sum k

You have given array of integer numbers and you need to find the pair of elements having sum k. An array is a collection of items stored at contiguous memory… Read more »