Company: Goldman sachs_19aug

Difficulty: medium

Problem Statement

Concert Seating Arrangement Problem Description A venue coordinator is arranging seats for an upcoming concert according to ticket types. Each ticket type is a distinct English alphabet letter, and everyone arriving together with the same ticket type is seated in a single shared block. There is also a VIP row at the very front reserved for exactly one guest, no matter how the rest of the seating works out. Write a program that reads a number N giving the count of ticket holders and an array ticketType of N uppercase English letters giving each person's ticket type, and reports how many distinct seating blocks are needed. A fresh block begins every time the ticket type changes, and the VIP seat always counts as its own separate block placed first. Read the input from STDIN and print the output to STDOUT. Do not print arbitrary strings anywhere in the program, as these contribute to the standard output, and test cases will fail. Constraints 1 <= N <= 10^7 Each ticket type is an upp

More Goldman sachs_19aug OA questionsInterview experiences