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.
SET @a = (
SELECT MIN(LAT_N) FROM STATION
)
SET @b = (
SELECT MIN(LONG_W) FROM STATION
)
SET @c = (
SELECT MAX(LAT_N) FROM STATION
)
SET @d = (
SELECT MAX(LONG_W) FROM STATION
)
SELECT ROUND(ABS(@c - @a) + ABS(@d - @b), 4, 0);
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 →
In SQL Server:
DECLARE @a FLOAT, @b FLOAT, @c FLOAT, @d FLOAT
SET @a = ( SELECT MIN(LAT_N) FROM STATION ) SET @b = ( SELECT MIN(LONG_W) FROM STATION ) SET @c = ( SELECT MAX(LAT_N) FROM STATION ) SET @d = ( SELECT MAX(LONG_W) FROM STATION ) SELECT ROUND(ABS(@c - @a) + ABS(@d - @b), 4, 0);