HackerRank SWE Winter Internship 2021
Anonymous User
1141

image
image
image

4. Drugs and DEA
DEA is against the entire drug plantation and operation in Mexico and they have the satellite images of the drug farms. They want to burn them but before that they want the exact size and number of farms of each size to start their operation.

Unfortunately, the DEA people are not very bright, so they have hired you to help them process the image.

You will be given image in form of binary matrix: '1' is the drug farm area and '0' is normal region. Given this binary matrix, your job is to count the number of farms in the region and their corresponding sizes. Two adjacent pixels in the image are considered to be in the same farm if they are in the same row or the same column.
image
image
image

**2. Assebly Line **
There are many students standing in the morning assembly of a school. Students are standing in a straight horizontal line and each student is standing such that they can see in left direction. Student X shall block the vision of student Y if student X is present to the left of student Y and student X is taller than student Y.
So,the vision of a student can be defined as :{(the number of contiguous students just to the left of the given student whose height is less than or equal to the height of the given student) + 1}.

You need to write a program that finds the vision of each student.
image

Comments (2)