Avg CTC: 18
Job Link: Contest Link for job roles
Data encryption is a very important aspect for transferring data over the internet. There various encryption techniques like AES, RSA and Triple DES.
We have a unique encryption technique where we share a L x L matrix which contains a dollar pattern, to decrypt the message we have to remove all the dollar signs in the matrix, the minimum cost to remove the dollar signs is the original message.
We are allowed to the following actions on the matrix one or more times to remove all the dollar signs.
Help the person decrypt the message from the matrix which is the minimum cost.
The input will be L number of strings, P, with L characters. The $ sign indicates a dollar whereas a - indicates clear block.
Constraints
Example 1
Command line input:
5
$$---
-$$--
$-$--
-----
----$
Output
4
Explanation:
thanks for pointing out dev. updated.