Question: I am looking for the solution of this program in C++ programming language. I have attached the picture below and also the test cases it

I am looking for the solution of this program in C++ programming language. I have attached the picture below and also the test cases it needs to pass. Page_1 :

I am looking for the solution of this program in C++ programming

Page_2 :

language. I have attached the picture below and also the test cases

Test Cases :

# test case 1 # B=['.##.#','#.#..','#...#','#.##.']

# test case 2 # B=['.#..#','##..#','...#.']

# test case 3 # B=['##.','#.#','.##']

# test case 4 # B=['...','...','...']

Submarines of size 2 , which come in two shapes: Destroyers of size 3 , which come in six shapes: that, given an array B consisting of N strings of length M each, returns an array R of three integers, such that: - R[0] represents the number of Patrol Boats, - R[1] represents the number of Submarines, - R[2] represents the number of Destroyers. Examples: 1. Given B =[ ".\#\#.\#", "\#.\#. .", "\#...\#", "\#.\#\#."], the function should return [2,1,2] as explained above. 2. Given B=[ [".\#. .\#", "\#\#..\#", "...\#."], the function should return [1,1,1]. 3. Given B = ["\#\#.", "\#.\#", ".\#\#"], the function should return [0,0,2]. 4. Given B = ["...", "...", "..."], the function should return [0,0,0]. Assume that: - N is an integer within the range [1..100]; - all strings in B are of the same length M from the range [1..100]; - every string in B consists only of the following characters: '.' and/or 'f; - every ship on the board is either a Patrol Boat (size 1), a Submarine (size 2) or a Destroyer (size 3)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!