DRCTN - Editorial

Problem Link : https://www.codechef.com/problems/DRCTNSRM

Initial Approach :This problem can simply be solved by considering sumit position be a point on a 2D x-y graph.

Final Approach : Now to take another step to solve the problem, declare and initiate two variable denoting the distance traveled in parallel to a particular axis. Iterate through the string and increment the variable for x axis if ‘N’ occurs and decrement it if ‘S’ occurs. Same goes with ‘E’ and ‘W’.It is to be noted that final position of the sumit will never be (0,0) as already mentioned in the problem.

Solution : https://ideone.com/c2aiC8

1 Like

nice solution… keep going.

kanker prostat stadium 4, gejala, penyebab dan pengobatan
I can learn a lot and could also be a reference I hope to read the next your article updates, Thank you for sharing in this article,wish you all success.
pengobatan kanker prostat stadium 4, stadium 3, stadium 2, stadium 1, stadium akhir, stadium lanjut