Company: HSBC_3sep
Difficulty: medium
Battleships on a Board Problem Description Your task is to find the number of ships of each type occurring on the board. The board is represented by an array of N strings of length M. Each character is either '.' (empty sea) or '#' (a part of a ship). Ships do not touch each other, not even diagonally. Ships can be of three types: Patrol Boat : size 1, a single # . Submarine : size 2, two adjacent # s (horizontally or vertically). Destroyer : size 3, three adjacent # s. Destroyers come in six shapes: 1. ### 2. # 3. ## 4. ## 5. .# 6. #. # # .# ## ## # Write a function: vector<int> solution(vector<string> &B); 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. In your solution, focus on correctness. The performance of your solution will not be the focus of the assessment. Examples Exa