def by_candidate
      placements =
        by_target.to_a.flat_map { |t, cs| cs.map { |c| [c, t] } }.to_h
      candidates.map { |c| [c.object, placements[c.object]] }.to_h.freeze
    end
def by_candidate
      placements =
        by_target.to_a.flat_map { |t, cs| cs.map { |c| [c, t] } }.to_h
      candidates.map { |c| [c.object, placements[c.object]] }.to_h.freeze
    end
Returns a hash where the keys are the candidates in the match, and the
 values are the targets selected for each candidate (or nil, if the
 algorithm was unable to place the candidate).

 @return [Hash<MatchyMatchy::Target, Array<MatchyMatchy::Candidate>>]