Interesting Problems — help needed

Правка en3, от rajkumar62506, 2022-05-15 05:29:04

Hello Coders, Recently In online test of BNY company these two questions were asked. It will be great if someone can give approach to solve these questions.

  1. Given two arrays of integer A and B of length n. We have to choose k indexes such that min(Sum of elements of A at chosen indexes, sum of elements of B at chosen indexes) is maximized. We have to return that maximum sum.

1<=A[i],B[i],n<=50

1<=k<=n

  1. Given integer array A of length n. Initially our power will be 0. Now in one operation we can choose two indexes i and j, i != j. Now we can add A[i] ^ A[j] to power and have to remove any one element. So after n — 1 operation we will be left with only 1 element. At that point we have to stop the process. We have to return what is the maximum power we can collect.

1 <= n <= 1000

1 <= A[i] <= 10^9

Теги online test, help, coding

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en3 Английский rajkumar62506 2022-05-15 05:29:04 4
en2 Английский rajkumar62506 2022-05-15 05:28:14 26
en1 Английский rajkumar62506 2022-05-15 05:27:07 867 Initial revision (published)