Skip to content

Instantly share code, notes, and snippets.

import org.junit.Test;
import static org.junit.Assert.assertEquals;
/**
* Given a positive integer, return its corresponding column title as appear in an Excel sheet.
*
* Example:
* 1 -> A
import org.junit.Test;
import java.util.ArrayList;
import java.util.List;
/**
* Given two numbers as arrays multiply them.
*/
public class MultiplyArray {
import org.junit.Test;
import java.util.ArrayList;
import java.util.Arrays;
import static org.junit.Assert.assertEquals;
/**
* Given a binary tree, determine if it is height-balanced.
* For this problem, a height-balanced binary tree is defined as a binary tree in
@NakulRajan
NakulRajan / ValidParentheses.java
Last active July 9, 2016 04:04
Check whether Valid Parentheses
import org.junit.Test;
import java.util.HashMap;
import java.util.Stack;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
/**
* Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.
@NakulRajan
NakulRajan / BlobCount.java
Last active July 8, 2016 17:00
Given a character matrix and a char, find the number of character islands
package Graphs;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
/**
* Given a 2D matrix of characters like
* BBBBBBB
* GGBBBGG