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.
The above line calcalates the apple's position by adding the variables a and d (where d is read from input). The problem has a picture that shows what these correspond to.
if(applePosition>=s&&applePosition<=t)
The above line checks to see if the apple's position is in between s and t. These 2 variables are also depicted in the problem's picture.
Apple and Orange
You are viewing a single comment's thread. Return to all comments →
The above line calcalates the apple's position by adding the variables a and d (where d is read from input). The problem has a picture that shows what these correspond to.
The above line checks to see if the apple's position is in between s and t. These 2 variables are also depicted in the problem's picture.
HackerRank solutions.