code: private List<Match> findGoodEnoughCombination(final String password, final List<Match> all_matches, final Map<Integer, Match> brute_force_matches)
      {
          int length = password.length();
          Match[] match_at_index = new Match[length];
          List<Match> match_list = new ArrayList<>();
  
          // First pass through the password forward.
          // Set the match to be the lowest average entropy for the length the part of the password takes.
          for (int k = 0; k < length; k++)
          {
              for (Match match : all_matches)
              {
                  if (match.getEndIndex() == k)
                  {
                      if (match_at_index[k] == null || match_at_index[k].calculateEntropy() / match_at_index[k].getLength() > match.calculateEntropy() / match.getLength())
                      {
                          match_at_index[k] = match;
                      }
                  }
              }
          }
  
  
          // Now go backwards through the password.
          // Fill in any empty matches with brute force matches, add all matches to the match_list in reverse order.
          int k = length - 1;
          while (k >= 0)
          {
              Match match = match_at_index[k];
              if (match == null)
              {
                  match_list.add(brute_force_matches.get(k));
                  k--;
                  continue;
              }
              match_list.add(match);
              k = match.getStartIndex() - 1;
          }
  
          // Reverse the order of the list so it's now first to last.
          Collections.reverse(match_list);
          return match_list;
      }
docs: This is the original algorithm for finding the best matches.  It was much faster, but had the possibility of returning
  non-optimal lists of matches.  I kept it around to run preliminarily to pass the results to {@code isRandom} so we can
  see if the password is random and short circuit the more expensive calculations
  
  @param password            the password
  @param all_matches         all matches which have been found for this password
  @param brute_force_matches map of index and brute force match to fit that index
  @return a list of matches which is good enough for most uses