OA Round (codility) -
1. There a N boxes arranged in a row, where kth box contains A[k] bricks. The problem asks for the minimum moves to distribute bricks such that every box has exactly 10 bricks.
2. Seating arrangement in an airline. An airplane has N rows of seats, numbered from 1 to N. There are ten seats in each row (labelled from A to K, with letter I omitted). Some of the seats are already reserved. The list of reserved seats is given as a string S (of length M) containing seat numbers separated by single spaces: for example, "1A 3C 2B 20G 5A". The reserved seats can be listed in S in any order. Your task is to allocate seats for as many four-person families as possible. A four-person family occupies four seats in one row that are next to each other—seats across an aisle (such as 2C and 2D) are not considered to be next to each other. It is permissible for the family to be separated by an aisle, but in this case exactly two people have to sit on each side of the aisle (for example, seats D, E and F, G within the center block). Obviously, no seat can be allocated to more than one family.