Company: Nvidia_23april
Difficulty: medium
Bitwise Recurrence Relation Problem Description A recurrence relation is an equation that expresses each element of a sequence as a function of the preceding ones. Consider the recurrence relation where F(i) = F(i-1) + F(i-2) + F(i-3). Here '+' is the bitwise XOR operator. Given four integers a, b, c, and n, find Fn. Complete the function bitwiseRecurrence in the editor below. The function must return F[n]. bitwiseRecurrence has the following parameters: a : an integer denoting F[0] b : an integer denoting F[1] c : an integer denoting F[2] n : an integer long bitwiseRecurrence(long a, long b, long c, long n) { // Function implementation goes here } Examples Example 1: Input: a = 4, b = 1, c = 10, n = 4 Output: 14 Explanation: F[0] = 4, F[1] = 1, F[2] = 10 F[3] = (F[2] ^ F[1]) ^ F[0] = (10 ^ 1) ^ 4 = 11 ^ 4 = 15 F[4] = (F[3] ^ F[2]) ^ F[1] = (15 ^ 10) ^ 1 = 5 ^ 1 = 4 Hence, in this case, returned value should be 14. Constraints 0 Sample Cases Sample Case 0: Input: a = 3, b = 2, c = 5, n