LiveRamp interview question

Normal codility exercises.