Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Codility Interview Reschedule Reques static class Task ( int du : . app.codility.com / c / run / XQHB 3 K - EQM / Microsoft

Codility
Interview Reschedule Reques
static class Task
(int du
:.
app.codility.com/c/run/XQHB3K-EQM/
Microsoft Office H...
Scheduledata
Exchange_Mail
News
Translate
E Mrorsoth
1
Task 1
Files
2
There is a board of size NM(represented by an array board consisting of strings). Rows are numbered from 0 to N-1(from top to bottom) and columns are numbered from 0 to M-1(from left to right). Each cell is either empty (denoted by '.') or contains a letter A or B. The cell in the R-th row and C-th column is represented by board [R][C].
Calculate the number of rectangles inside the board with a corner at position (0,0)(board [0][0]) which cover an equal number of letters A and B.
For example, for board =["AB.","BY.",".. A"], there are five such rectangles:
the first row without the last element (marked in the picture below);
the whole first row;
symmetrically, the whole first column (marked below) and the first column without the last element;
the whole board.
\table[[,0,1,2],[,A,B,],[,B,.,*
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Pro SQL Server Wait Statistics

Authors: Enrico Van De Laar

1st Edition

1484211391, 9781484211397

More Books

Students also viewed these Databases questions

Question

1. Watch what students do with their free time.

Answered: 1 week ago