Finding the Most Vulnerable Farmer
Given a 2D grid representing a farmland where 1 denotes a defender and 0 denotes a farmer, find the position of the most vulnerable farmer. A farmer's vulnerability is defined by the number of defenders present before them in their row. Return the position as a 1-based index [row, column].
Asked at:
Amazon
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
Late September, 2024
Amazon
Intern
Finding the Most Vulnerable Farmer: Given a 2D grid representing a farmland where 1 denotes a defender and 0 denotes a farmer, find the position of the most vulnerable farmer. A farmer's vulnerability is defined by the number of defenders present before them in their row. Return the position as a 1-based index [row, column].
Hello Interview Premium
Your account is free and you can post anonymously if you choose.