Skip to content

Instantly share code, notes, and snippets.

@leosabbir
leosabbir / WordSearch.java
Created September 19, 2018 23:36
Implementation to determine if a word can be found in given 2D matrix
/* File: WordSearch.java
* Created: 9/19/2018
* Author: Sabbir Manandhar
*
* Copyright (c) 2018 WorldLingo Inc.
*/
//=======================================================================================
/**
@leosabbir
leosabbir / FlatlandSpaceStations.java
Created September 12, 2018 19:34
Compute maximum distance among all distances from a city to nearest space station
/* File: FlatlandSpaceStations.java
* Created: 9/12/2018
* Author: Sabbir Manandhar
*
* Copyright (c) 2018 Hogwart Inc.
*/
//=======================================================================================
import java.util.Arrays;
@leosabbir
leosabbir / InvertBinaryTree.java
Created August 30, 2018 18:05
Class to invert a binary tree
/* File: InvertBinaryNode.java
* Created: 8/30/2018
* Author: Sabbir Manandhar
*
* Copyright (c) 2018 Hogwart Inc.
*/
//=======================================================================================
import java.util.Stack;
/* File: SortLinkedList.java
* Created: 8/21/2018
* Author: Sabbir Manandhar
*
* Copyright (c) 2018 Hogwart Inc.
*/
//=======================================================================================
/**
@leosabbir
leosabbir / StockCacheTest.java
Last active August 17, 2018 21:50
Test class to demonstrate setting private field using PowerMockito
/* File: StockCacheTest.java
* Created: 8/17/2018
* Author: Sabbir Manandhar
*
* Copyright (c) 2018 Hogwart Inc.
*/
//=======================================================================================
import junit.framework.Assert;
@leosabbir
leosabbir / BinaryTreePathToNodeFromRoot.java
Last active June 13, 2018 17:54
Utility class to compute path from root node to a target node in a Binary Tree
/* File: BinaryTreePathToNodeFromRoot.java
* Created: 6/11/2018
* Author: Sabbir Manandhar
*
* Copyright (c) 2018 Hogwart Inc.
*/
import java.util.*;
/**
@leosabbir
leosabbir / RunWaySpikes.java
Created June 13, 2018 16:31
Determine if jumper can land safely within the runway starting at give position with given speed
/* File: RunWaySpikes.java
* Created: 6/12/2018
* Author: Sabbir Manandhar
*
* Copyright (c) 2018 Hogwart Inc.
*/
import java.util.HashMap;
import java.util.Map;
@leosabbir
leosabbir / LongestSubStringUniqueCharacters.java
Last active June 9, 2018 17:01
Compute maximum length of substring with uniqe characters
/* File: LongestSubStringUniqueCharacters.java
* Created: 6/8/2018
* Author: Sabbir Manandhar
*
* Copyright (c) 2018 WorldLingo Inc.
*/
/**
* @author Sabbir Manandhar [lastname][dot][firstname][dot]gmail[dot]com
* @version 1.0
@leosabbir
leosabbir / MissingNumber.java
Created June 8, 2018 16:03
Computes a missing number in the given input array containing numbers from 1 to n except one number
/* File: MissingNumber.java
* Created: 6/8/2018
* Author: Sabbir Manandhar
*
* Copyright (c) 2018 Hogwart Inc.
*/
import java.util.Arrays;
/**
@leosabbir
leosabbir / MissingTwoNumbers.java
Last active June 8, 2018 16:59
Finds the two missing numbers in the given array which contains numbers from 1 to n inclusive except two numbers
/* File: MissingTwoNumbers.java
* Created: 6/6/2018
* Author: Sabbir Manandhar
*
* Copyright (c) 2018 WorldLingo Inc.
*/
/**
* @author Sabbir Manandhar (lastname)(dot)(firstname)(at)gmail(dot)com
* @version 1.0