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}.
*Just getting started with coding interviews? Check out my “Get Ready for Your Coding Interview” course on Lynda.com:
https://www.lynda.com/Software-Development-tutorials/How-Ace-Developer-Interview/576698-2.html?lpk35=9181&utm_medium=ldc-partner&utm_source=CMPRC&utm_content=524&utm_campaign=CD20605&bid=524&aid=CD20605
(You’ll get a 30-day trial with the link)
source