Skip to content

Instantly share code, notes, and snippets.

joist

Block or report user

Report or block joist

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@joist
joist / Puddles.java
Last active Dec 26, 2015
My naive solution to a programmer puzzle I saw on hackernews. https://news.ycombinator.com/item?id=6639839 edit: Added the smart way of doing it too
View Puddles.java
public class Puddles
{
public static void main(String[] args) throws Exception
{
//set heights, need 2 or more
int[] groundheights = {2, 5, 1, 2, 3, 4, 7, 7, 6};
String gh = "Ground heights: ";
for (int i = 0; i<groundheights.length; i++)
{
if (i == 0) {
You can’t perform that action at this time.