fork download
  1. importPackage(java.io);
  2. importPackage(java.lang);
  3.  
  4. // your code goes here
  5.  
  6.  
  7. const showDuplicateSymbols= (e)=>{
  8.  
  9. const value = e.target.value.trim()
  10.  
  11. const uniqueChars = Array.from(new Set(value));
  12.  
  13. const twiceChars = uniqueChars.filter(
  14. (char) => value.split(char).length - 1 === 2
  15. );
  16.  
  17. return twiceChars.length > 0 ? value : " ";
  18.  
  19. }
Success #stdin #stdout 0.35s 42196KB
stdin
aa
stdout
Standard output is empty