is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.
CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.
Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.
Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.
Here is my Code in C++. Have a look.
- aleena January 14, 2015#include<iostream>
#include<stdio.h>
#define MAX 4
using namespace std;
bool NotInSqr(int mat[][MAX],int i,int j,int k,int n)
{
int srow=0,scol=0;
if(i>=0 && i<n/2)
srow=0;
else
srow=n/2;
if(j>=0 && j<n/2)
scol=0;
else
scol=n/2;
for(i=srow;i<srow+2;i++)
{
for(j=scol;j<scol+2;j++)
{
if(mat[i][j]==k)
return false;
}
}
return true;
}
bool NotInCol(int mat[][MAX],int i,int j,int k,int n)
{
int r;
for(r=0;r<i;r++)
{
if(mat[r][j]==k)
return false;
}
return true;
}
bool NotInRow(int mat[][MAX],int i,int j,int k,int n)
{
int r;
for(r=0;r<j;r++)
{
if(mat[i][r]==k)
return false;
}
return true;
}
void sudoku(int mat[][MAX],int i,int j,int *cnt,int n)
{
if(i>n || j>n)
return;
else if(i==n && j==0)
{
(*cnt)++;
int i1,j1;
for(i1=0;i1<n;i1++)
{
cout<<"\n";
for(j1=0;j1<n;j1++)
cout<<mat[i1][j1]<<" ";
}
cout<<"\n\n";
return;
}
else if(i<n && j<n)
{
int k;
for(k=1;k<5;k++)
{
if(NotInRow(mat,i,j,k,n) && NotInCol(mat,i,j,k,n) && NotInSqr(mat,i,j,k,n))
{
mat[i][j]=k;
sudoku(mat,(i+(j+1)/n),(j+1)%n,cnt,n);
mat[i][j]=0;
}
}
}
}
int main()
{
int n=4,cnt=0,mat[MAX][MAX];
memset(mat,0,sizeof(mat));
sudoku(mat,0,0,&cnt,n);
cout<<"No. of solutions are "<<cnt<<"\n";
return 0;
}