This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class PlusPattern { | |
/** | |
* Utility method to verify matrix dimensions | |
* | |
* @param a matrix to be verified | |
* @return true if matrix size is greater than 0; | |
*/ | |
private static boolean isValid(int[][] a) { | |
return a.length > 0 && a[0].length > 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.LinkedList; | |
import java.util.ListIterator; | |
/** | |
* Created by Abhishek on 31-Oct-17. | |
* <p> | |
* http://www.geeksforgeeks.org/build-lowest-number-by-removing-n-digits-from-a-given-number/ | |
* <p> | |
* Build Lowest Number by Removing n digits from a given number | |
* 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.HashMap; | |
import java.util.TreeMap; | |
/** | |
* Created by Abhishek Anand on 01-Nov-17. | |
*/ | |
public class RomanNumeral { | |
private static final int D2R_METHOD_FLAG = 2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Arrays; | |
import java.util.Stack; | |
/** | |
* Created by Abhishek Anand on 24-Oct-17. | |
*/ | |
/* | |
Finds the next greatest element for each element in an array. -1 if no greater element is present. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import lombok.Data; | |
import lombok.extern.slf4j.Slf4j; | |
import java.time.Duration; | |
import java.time.LocalDateTime; | |
import java.util.*; | |
import java.util.concurrent.BlockingQueue; | |
import java.util.concurrent.TimeUnit; |