Who's in First Place?

Published by Mubashir Hassan in

Create a function that takes a string road and returns the car that's in first place. The road will be made of "=", and cars will be represented by letters in the alphabet.

Examples

firstPlace("====b===O===e===U=A==") ➞ 'A'

firstPlace("e==B=Fe") ➞ 'e'

firstPlace("proeNeoOJGnfl") ➞ 'l'

Notes

Return '0' if there is no car on the road and '0' if there is no road.

Watch a quick demo on how Edabit works.