drSdGdBy

counting duplicates chars

Oct 18th, 2020
488
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. text.toLowerCase().chars()
  2. .boxed()
  3. .collect(Collectors.groupingBy(k -> k,Collectors.counting()))
  4. .values().stream()
  5. .filter(e -> e > 1)
  6. .count();
RAW Paste Data