Company: Goldman Sachs_10july
Difficulty: medium
Seating Arrangement Scatter Value Problem Description Malathi is a teacher who teaches Grade 2. She has fifteen students in her class, with one seat left empty. The assigned seating arrangement is a 4x4 grid, with students represented by uppercase letters 'A' to 'O' and the empty seat by a '.' (dot). The assigned arrangement is as follows: A B C D E F G H I J K L M N O . Every morning, the students come in and sit in any seat randomly. When Malathi arrives, she moves all the children to their assigned seats. Since this happens on a daily basis, Malathi wants to understand how different the daily random seating is compared to the assigned seating. To measure this, she wants to calculate the "scatter" of the seating arrangement. To calculate the scatter, one needs to measure the Manhattan distance for each student (and the empty seat) between their current position and their assigned position, and sum up all these distances. The Manhattan distance between two seats at positions (r1, c1)