code: def words_combinations(f, *texts) -> float:
      m = float("Inf")
      # split by words
      texts = [t.split() for t in texts]
      # permutations
      texts = [permutations(words) for words in texts]
      # combinations
      for subtexts in product(*texts):
          if f.equality:
              words_min_cnt = len(min(subtexts, key=len))
              subtexts = [t[:words_min_cnt] for t in subtexts]
          subtexts = [" ".join(t) for t in subtexts]
          m = min(m, f(*subtexts))
      return m
  
imports: from __future__ import annotations
  from itertools import permutations, product
  from typing import Sequence
label_desc: Use image node_id 1 for calling a global function with example usage: words_combinations(f) and returns: m