All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com_github_leetcode.BinaryMatrixImpl Maven / Gradle / Ivy

There is a newer version: 1.37
Show newest version
package com_github_leetcode;

import java.util.ArrayList;
import java.util.List;

public class BinaryMatrixImpl implements BinaryMatrix {

    private final int[][] matrix;

    public BinaryMatrixImpl(int[][] matrix) {
        this.matrix = matrix;
    }

    @Override
    public int get(int x, int y) {
        return matrix[x][y];
    }

    @Override
    public List dimensions() {
        List dimensions = new ArrayList<>();
        dimensions.add(matrix.length);
        dimensions.add(matrix[0].length);
        return dimensions;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy