The setting is a recruitment examination for an IT company, there are six finalists who are given the task to…