Erica and Bob participate in a friendly Hackathon that allows each to solve one question a day
Question:
Erica and Bob participate in a friendly Hackathon that allows each to solve one question a day out of the three offered. There will be one easy, one medium and one hard question, with points awarded based on difficulty. The participant can also choose to skip a question. The winner is the one with the highest score at the end of the competition based on the following scale. In case of a tie, the person who solves the most hard problems wins. If it's the same, the one with more medium problems wins; otherwise, the one with more easy problems wins. If they both have the same score and the same number of problems at the same difficulty level, then it's a tie.
You will be given two strings with each character of the strings indicating the difficulty of the problem solved on day f iJ of the Hackathon by a coder. You are to calculate the scores for Erica and Bob and then return the name of the winner: Erica, Bob or if they tie: Tie. Function Description
Complete the function winner in the editor below. The function must return the name of the winner Erica or Bob, or lie if their scores are equal and they've done the same number of problems at each difficulty level.
Winner has the following parameter(s):
Erica: an string where erica(iJ denotes the difficulty of the problem she solved on day i
Bob: an string where bobrn denotes the difficulty of the problem he solved on day i
Statistics Unlocking the Power of Data
ISBN: 978-1118583104
1st edition
Authors: Robin H. Lock, Patti Frazer Lock, Kari Lock Morgan, Eric F. Lock, Dennis F. Lock