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.
with base as (
select city,
LENGTH(city) as size,
row_number() over (partition by LENGTH(city) order by city) as row_id
from station
where LENGTH(city) = (select max(LENGTH(city)) from station)
or LENGTH(city) = (select min(LENGTH(city)) from station)
order by LENGTH(city) desc, city asc
)
select city,size
from base
where row_id=1
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 5
You are viewing a single comment's thread. Return to all comments →
with base as ( select city, LENGTH(city) as size, row_number() over (partition by LENGTH(city) order by city) as row_id
from station where LENGTH(city) = (select max(LENGTH(city)) from station) or LENGTH(city) = (select min(LENGTH(city)) from station) order by LENGTH(city) desc, city asc ) select city,size from base where row_id=1