Here is a problem that was given to me as part of an online technical screening test on hackerearth. I don\'t remember the question word to word but will do my best in detailing