Google
Sign Up/Sign In
All jobs
Report
Google | SWE | Online Screening
Location
remote
JobType
full-time
About the job
This job is sourced from a job board
Overview
About the role
Problem 1 Click here to Practice Submit Problem to OJ You are given an Array A of size N and an integer N. Find the minimum vale K such that the number of subarrays of A having XOR value of at most K is atleast X. 1 <= N <= 105 1 <= X <= N x (N+2) / 2 1 <= A[i] <= 106 Sample Input : 4 7 1 2 3 4 Sample Output : 4 Explanation : Given number of subarrays to be atleast 7, i.e. X = 7. So if we select the value for K to be 3, number of subarrays of A having XOR value atmost 3 is 6. If we select the minimum value for K to be 4, number of subarrays of A having XOR value atmost 4 is 8. So, the minimum value of K for which number of subarrays of A is atleast 7, each of which have XOR value of atmost K is 4. Problem 2 Given an subarray A of size N, you need to find a triplet say Ai, Aj, Ak with maximum sum which respects following two conditions :- i < j < k Ai <= Aj <= Ak This problem is almost same as Mock Interview - II !
Skills
google
swe
xor
subarray
Apply for this job