Tag: interview

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 »

Rearrange linked list into an alternating high – low values

Daily Coding Problem: Problem #256 [Medium] Given a linked list, rearrange the node values such that they appear in alternating low -> high -> low -> high … form. For example, given 1 -> 2… Read more »

Write a function to flatten a nested dictionary separated by period

This problem was asked by Stripe. Write a function to flatten a nested dictionary. Namespace the keys with a period. For example, given the following dictionary: it should become: You… Read more »