We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
UPPER(SUBSTRING(CITY, 1, 1)): This gets the first character of the CITY name and converts it to uppercase for comparison.
IN ('A', 'E', 'I', 'O', 'U'): This checks if the first or last character is one of the vowels.
LENGTH(CITY): This finds the length of the CITY name to reference the last character.
SUBSTRING(CITY, LENGTH(CITY), 1): This gets the last character of the CITY name.
DISTINCT: Ensures that only unique cities are included in the result.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Weather Observation Station 9
You are viewing a single comment's thread. Return to all comments →
UPPER(SUBSTRING(CITY, 1, 1)): This gets the first character of the CITY name and converts it to uppercase for comparison. IN ('A', 'E', 'I', 'O', 'U'): This checks if the first or last character is one of the vowels. LENGTH(CITY): This finds the length of the CITY name to reference the last character. SUBSTRING(CITY, LENGTH(CITY), 1): This gets the last character of the CITY name. DISTINCT: Ensures that only unique cities are included in the result.