Initial commit of implementation to problem given in google interview