Sudoku Solver
Sudoku Solver
h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<long long int> vlli;
#define pb push_back
#define endl '\n'
#define FastIO ios_base::sync_with_stdio(0);cin.tie(0);
ll rn = sqrt(n);
ll sx = (i / rn) * rn;
ll sy = (j / rn) * rn;
return true;
}
// Base case
if (i == n) {
/* since we're solving row wise, if we reach the n th column
it would mean that all n-1 rows, i.e. the entire sudoku has been
solved*/
// Recursive case
// Fill te empty cell with all possible options
for (int number = 1; number <= 9; number++) {
if (canPlace(mat, i, j, n, number)) {
// Assume
mat[i][j] = number;
// Backtrack
mat[i][j] = 0;
return false;
}
int main() {
FastIO
// freopen("input.txt","r",stdin);
// freopen("output.txt","w",stdout);
return 0;
}