Question: Please explain each step and the logic behind it. HackLand Election In lections hat uso the ballot bax sys em or voting, oach voter writes

Please explain each step and the logic behind it. HackLand Election Inlections hat uso the ballot bax sys em or voting, oach voterwrites name e a candidate cn a ba lo and P acosPlease explain each step and the logic behind it.

HackLand Election In lections hat uso the ballot bax sys em or voting, oach voter writes name e a candidate cn a ba lo and P acos it in he ballot ox T e candidate with ho h ghes number a voto wins h ectiorIf wo or moro cane e ate; havo the same nunnber a votos, hon od candidates namie are rdered olphabetically and the last nama in the alphabatical order wins For example, vates are in the namesJoe, Mary, Mary Joe'). Each candidate received two wotes, but Mary is alphabetically later than Joe, so she wins Function Description Complete the function electionWinner in the editor below The function must return a string denoting the name of the winning candidate electionWinner has the following parameterts votes/votes 01. votesn-7an array of strings representing the names of the candidates as voted by thewater Constraints 1ins10

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!