Company: Nvidia_23april
Difficulty: medium
Bitwise Recurrence Relation Problem A recurrence relation is an equation that expresses each element of a sequence as a function of the preceding ones. Consider the sequence F defined by F[i] = (F[i-1] OR F[i-2]) XOR F[i-3] for every i >= 3 where OR is the bitwise OR operator and XOR is the bitwise XOR operator. (inferred - the defining formula in the source screenshot is blurred and its operator symbols did not survive in the stored text; the operators and their grouping are recovered from the source's own worked examples, which this is the only standard-operator form to reproduce.) The first three terms are given: F[0] = a , F[1] = b , F[2] = c . Given four integers a , b , c and n , find F[n] . Complete the function bitwiseRecurrence(a, b, c, n) in the editor. It must return F[n] . Input Format Four lines, each holding one integer: line 1: a , the value of F[0] line 2: b , the value of F[1] line 3: c , the value of F[2] line 4: n , the index of the term to find Output Form