Successful solution for Chef and Rainbow Array - 2 problem - http://www.codechef.com/SEPT14/problems/RAINBOWB