Given three integers 'A' denoting the first term of an arithmetic sequence , 'C' denoting the common difference of an arithmetic sequence and an integer 'B'. you need to tell whether 'B' exists in the arithmetic sequence or not.
Input: A = 1, B = 3, C = 2
Explaination: 3 is the second term of the
sequence starting with 1 and having a common
Input: A = 1, B = 2, C = 3
Explaination: 2 is not present in the sequence.
You do not need to read input or print anything. Your task is to complete the function inSequence() which takes A, B and C and returns 1 if B is present in the sequence. Otherwise, returns 0.
Expected Time Complexity: O(1) Expected Auxiliary Space: O(1)