This question was asked by Tesla during my on campus placement, please can I get a solution?

Once upon a time, there was a group of 'N' Ninjas who loved to play games together. They had an array 'A' of 'N' non-negative integers, …
View full source