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.
Using another 2 dimensional array that counts for each position the number of adjacent isles.
- vesh February 08, 2017For example, for the following board:
o x o
x o x
o x x
the extra matrix will look as follows
2 -1 2
-1 4 -1
2 -1 -1
where -1 signals 'x'
when changing 'o' to 'x' we increment all adjacent (horizontal and vertical) counters.
in addition, save a global counter for the number of isles in the board which will be incremented by 1 when changing 'o' to 'x' in a position i,j with corresponding counter equal to zero, and will be decremented by MIN(isles - 1, counters[i][j]-1) and will be returned by the function.