check repeatation in the given string and find largest time found world in javascript

technical talkiess
0

 check repeatation in the given string and find largest time found world


<script>

const stringcharcount = (str)=>{

alert();

let obj = {};

for(let char of str)

(!obj[char]) ?obj[char]=1:obj[char]++;

let maxnumber = 0;

let maxchar = '';

for(let char in obj)

    if(obj[char] >= maxnumber){

        maxnumber = obj[char];

        maxchar = char;

    }

   console.log("maximum char:"+maxchar + "occurance "+ maxnumber) 

}


stringcharcount("vishalvuisete333");

</script>
Tags

Post a Comment

0Comments

Thanks you for commenting your questions. I will see question and respond you.

Post a Comment (0)