Problem Description:
In this problem, a photo can be represented as a matrix sized \(n × m\), and each element of the matrix stores a symbol indicating corresponding pixel color. There are only 6 colors:
If there is any pixel of C, M, Y in the photo, then it is colored. Otherwise, it is black and white. We have to find out that the photo is black and white or colored.
Ideological Analysis:
Black and white photos contain only ‘B’, ‘W’ and ‘G’ pixels. We can check if any pixel is found ‘C’, ‘M’ or ‘Y’ then print "#Color" (without quotes). Otherwise, print "#Black&White" (without quotes).
Click here for Source Code.
Tanjina Rahman, 31 May, 2021
Share this article on →