Take an integer N and the student's seed value. Repeat the following
exactly 3 times:
if the current number is even, replace it with current / 2 + seed
otherwise, replace it with current * 3 - seed
After 3 steps:
print YES if the final number is between 100 and 999 inclusive, and
the middle digit of the final number is equal to seed
Otherwise print NO.
Input Format: Take N and seed using prompt() Output Format: Use alert() to show YES or NO along with the final number. Constraints: 1 ≤ N ≤ 10^6, 0 ≤ seed ≤ 9
Solution:
Press the button to execute JS solution of the question.