JSFiddle - React, Tailwind, and code Playground

by luka kupunia

JavaScript

function duplicateCount(o){
var l=Array.from(o.toUpperCase()).sort(),
		a=0;
		for(var e=0;e<l.length;e++)l[e]===l[e+1]&&null!=l[e]&&l[e]!==l[e-1]&&(l[e],a++);
}
duplicateCount("aabBcde");