Marlabs interview question

patching based