Skip to content

Instantly share code, notes, and snippets.

@ericzakariasson
Last active March 28, 2020 08:20
Show Gist options
  • Save ericzakariasson/91b0bc2a04e745d446528805a87cd851 to your computer and use it in GitHub Desktop.
Save ericzakariasson/91b0bc2a04e745d446528805a87cd851 to your computer and use it in GitHub Desktop.
/*
Guven an island with the shape of this:
__
__|__| __
__ |__|__| __ __|__|
|__| __|__|__|__|__| |__|__|__
|__|__|__|__|__|__|__|__ __ |__|__|__|__
__|__|__|__|__|__|__|__|__|__|__|__|__|__|__|__|
[0, 3, 1, 2, 4, 5, 2, 3, 1, 0, 1, 0, 3, 4, 2, 1] => 18
How much water can it hold if it rains?
*/
function main(nums: number[]): number {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment