It’s time to board The Badger and cruise across Lake Michigan! The Badger uses assigned seating on the top deck, where seats are in three columns separated by aisles. Several tickets have already been purchased. Our goal is to find all of the possible contiguous seating locations for a family of three. The seats cannot be separated by an aisle. Also, multiple permutations of seating arrangements within a column (or “cluster”) of seats does not constitute multiple valid locations: if four contiguous seats are available, this only constitutes one valid seating location.
The challenge: write a function in a language of your choosing. This function will take in two arguments: 1) an array of purchased seats in no particular order with the syntax of [row][seat], and 2) the number of rows. The seats in each row are arranged thusly: a cluster of three (A, B, and C), a cluster of four (D, E, F, and G), and a cluster of three (H, J, and K). Please note the lack of a seat I (as in India). The function should return the valid number of seating locations for the family of three.
This challenge can be completed using both front end and back end technologies. For the front end students, feel free to craft a gorgeous interface! Dazzle us with modals, transitions and any other goodies you may desire. Be sure to practice your git skills: initialize a repo and commit your changes as you work. Bonus front end challenge: create an interactive UI which allows a user to select the seats to be added to the reserved seats array.
Of course there is. Check it out!