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.
select round((abs(a-c)+abs(b-d)),4) from(
select
(select min(lat_n) from station) as a,
(select min(long_w) from station) as b,
(select max(lat_n) from station) as c,
(select max(long_w) from station) as d
) as t;
if you want to do by defing each variable, otherwise u can use manhattan formula directly.
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 18
You are viewing a single comment's thread. Return to all comments →
select round((abs(a-c)+abs(b-d)),4) from( select (select min(lat_n) from station) as a, (select min(long_w) from station) as b, (select max(lat_n) from station) as c, (select max(long_w) from station) as d ) as t;
if you want to do by defing each variable, otherwise u can use manhattan formula directly.