Skip to content

Instantly share code, notes, and snippets.

View anandabhishek73's full-sized avatar

Abhishek Anand anandabhishek73

View GitHub Profile
@anandabhishek73
anandabhishek73 / PlusPattern.java
Last active October 25, 2017 13:09
Finds the size of largest ‘+’ formed by a particular element(here called 'symbol') in a 2D matrix of any size.
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;