Grab the City

Published by Matt in

Write a function to return the city from each of these vacation spots.

Examples

grabCity("[Last Day!] Beer Festival [Munich]") ➞ "Munich"

grabCity("Cheese Factory Tour [Portland]") ➞ "Portland"

grabCity("[50% Off!][Group Tours Included] 5-Day Trip to Onsen [Kyoto]") ➞ "Kyoto"

Notes

There may be additional brackets, but the city will always be in the last bracket pair.

Watch a quick demo on how Edabit works.