Weather Observation Station 12 Problem

In the given context, we have a table named 'station' which contains a column 'city'. The problem is to find out all the distinct city names that do not start or end with a vowel. The vowels considered here are 'a', 'e', 'i', 'o', 'u'.

Secure your next interview 🎯

CodeRankGPT is a tool powered by GPT-4 that quietly assists you during your coding interview, providing the solutions you need.
In real-time and absolutely undetectable 🥷

Here is the Weather Observation Station 12 Problem HackerRank solution using CodeRankGPT:

The solution uses a SQL query to solve the problem. The 'select distinct' statement is used to get unique city names. The 'where' clause is used to filter out the cities that do not start or end with a vowel. The 'left' and 'right' functions are used to get the first and last character of the city names respectively, and the 'not in' operator is used to check if these characters are not vowels.


select distinct city from station where left(city,1) not in('a','e','i','o','u') and right(city,1) not in('a','e','i','o','u');

If you have a HackerRank coding test coming up, you can use CodeRankGPT to your advantage. It will assist you during your interview and help ensure you get the job.

AI is here now, and other candidates might be using it to get ahead and win the job. 🧐

Built on Unicorn Platform