Last Updated: 22 Feb, 2017

Valid Sudoku

Moderate
Asked in company
Cimba.ai

Problem statement

You are given a (9X9) square integer matrix, that contains values between 0-9.This matrix represents a sudoku. Check if sudoku is valid or not.

- The sudoku can be completely filled or partially filled.
- An entry 0 indicates that the corresponding cell is empty.
- Your task is to find out whether this sudoku is valid or not.
- Standard sudoku rules are to be enforced to check whether a sudoku is valid/invalid.
    1. No value should be repeating in a given row.
    2. No value should be repeating in a given column.
    3. No value should be repeating in each of the 9 (3X3) square grids.
- Return a boolean response.
Input Format :
 Line 1 : contains the corresponding ith and jth entries of the 2D matrix
Sample Output :
true or false