added template for this problem model after the C++ template provided by hackerrank.com