Coding Interview Question and Answer: Longest Consecutive Characters

Given a string, find the longest subsequence consisting of a single character. Example: longest(“ABAACDDDBBA“) should return {’D’: 3}.
Back to Top