Computer Science, asked by BARANWAL4766, 11 months ago

You are given an array of n integers . Find and output the bitwise or of xors of all the possible subarrays of the given array . Input format the first line will consist of the number of elements in the array i.E n. The next line will consist of n space separated integers denoting the elements of the array . Output format output a single value denoting the bitwise or of xors of all the subarrays of the given array

Answers

Answered by Anonymous
0
number k, find all elements that appear more than n/k times

Given an array of size n, find all elements in array that appear more than n/k times. For example, if the input arrays is {3, 1, 2, 2, 1, 2, 3, 3} and k is 4, then the output should be [2, 3]. Note that size of array is 8 (or n = 8), so we need to find all elements that appear more than 2 (or 8/4) times. There are two elements that appear more than two times, 2 and 3.

Similar questions