The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | May 2017 |
| Last Sign in: | 398 Weeks Ago, 3 Days Ago |
| Questions Answered: | 66690 |
| Tutorials Posted: | 66688 |
MCS,PHD
Argosy University/ Phoniex University/
Nov-2005 - Oct-2011
Professor
Phoniex University
Oct-2001 - Nov-2016
Phillip and Thomas got into an argument over who is the better tennis player. After realizing that they could debate for hours without actually proving anything, they grabbed their rackets and ran out to the courts. When they came back, they admitted that they lost track of who actually won. They did, however, record who scored each point. When Phillip scored a point, they wrote down an "A." When Thomas scored a point, they wrote down a "B." Write a program that takes a list of "A"s and "B"s and outputs who won the game and the final set score.
Â
Â
Â
A list of A's and B's.
Â
Â
A and B's final score and who won.
Â
Tips:
Â
Â
Â
Input: a a b a a a b b b a a a a b b b b a b a a b a b b b b b b b b a a a a a b a a a b a b b a b a a b b a a b b b b b b a b b a a a b a a a b a a b b b a b b b b b a a a b a b b b a b b b b b a a a a a b a a a b a a a a a a a b a a a a a b b a b b b a b b b a b a b b b b a b b b b a b b a b a a a b a b a b b a b a a a b a a a b a a b b a b b a a a b a a b a a a a a b a a a a a a a a a b b b b a a a b b b a b a b a b a b a a Output: A: 3 sets B: 1 sets A wins
Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n.P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll