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.
as x- axis can be moved by only a+b or a-b operation to reach x,
so (x-a) should be multiple of b .. then only by adding b times some int we can reach x from a. similarily for y .. but this is giving wrong ans .. please tell where i am going wrong
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Possible Path
You are viewing a single comment's thread. Return to all comments →
as x- axis can be moved by only a+b or a-b operation to reach x, so (x-a) should be multiple of b .. then only by adding b times some int we can reach x from a. similarily for y .. but this is giving wrong ans .. please tell where i am going wrong