The code submitted for Hackerrank September 2020 Contest