[Algorithm] Coding Interview Question and Answer: Longest Consecutive Characters
Givenastring,findthelongestsubsequenceconsistingofasinglecharacter.Example:longest("ABAACDDDBBA")shouldreturn{'D':3}.conststr="AABCDDBBBEA";functionlongest(str){letmax_count=0,count=0,max_char=null,pr