Company: Barclays
Difficulty: medium
Question The current selected programming language is C++14 . We emphasize the submission of a fully working code over partially correct but efficient code. Once submitted , you cannot review this problem again. You can use cout to debug your code. The cout may not work in case of syntax/runtime error. The version of GCC being used is 5.5.0 . A University has invited N alumni to a dinner. The dinner table is circular in shape. The university has assigned each alumnus an invitation ID from 1 to N . Each alumnus likes exactly one fellow alumnus and will attend the dinner only if he/she can be seated next to that person. You are asked to plan the seating arrangement. Write an algorithm to find the maximum number of alumni who will attend the dinner. Input Format The first line of the input consists of an integer - personId_size , representing the number of alumni ( N ). The second line consists of N space-separated integers representing the ID of the person whom the i th alumnus likes. Ou