[M๐ Challenge] Grid Walking โฌโช๐โชโฌ
Monday Blue ๐ Challenge Series #6 Let's get moving this week! This time we will calculate the Euclidean distance from point A to B based on the path travelled on an unbounded grid. ๐ผ TASK Write a program to accept a string to indicate the path travelled with the following symbol:- [ N ] orth โฌ๏ธ [ E ] ast โก๏ธ [ W ] est โฌ ๏ธ [ S ] outh โฌ๏ธ and then output the straight-line (shortest) distance between the original position and final position. In case you're unfamiliar, you'll need to apply the distance formula from Pythagorean Theorem for this challenge. ๐ ๐ง TEST CASE "NE" 1.41 "WWW" 3.00 "NNNNN" 5.00 "EEENNNN" 5.00 "ENENENN" 5.00 "EEEWWW" 0.00 "SSWENNEW" 0.00 "SWSWSWSWSWSWSESWSESWSES" 13.00 โค BONUS Creative and clear-cut approach is encouraged. Happy Coding!!! ๐๐ป