working outfit algorithm with passing tests