Question: I am looking for a C++ program for below given question. (But please remember in C++ only) All the details are given in the question

I am looking for a C++ program for below given question. (But please remember in C++ only) All the details are given in the question . I need a code in C++ (not in any other language) The same question been answered in Python on this chegg platform i belive the question is correct. if possible do it in C or C++ only Thanks

Page_1 :

-------------

I am looking for a C++ program for below given question. (But

Page_2:

-------------

please remember in C++ only) All the details are given in the

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!