Who's in First Place?

Published by werdna 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 "No car available" if there is no car on the road and "No road available" if there is no road.

Watch a quick demo on how Edabit works.