3117. Minimum Sum of Values by Dividing Array
You are given two arrays
nums
andandValues
of lengthn
andm
respectively.The value of an array is equal to the last element of that array.
You have to divide
nums
intom
disjoint contiguous subarrays such that for theith
subarray[li, ri]
, the bitwiseAND
of the subarray elements is equal toandValues[i]
, in other words,nums[li] & nums[li + 1] & ... & nums[ri] == andValues[i]
for all1 <= i <= m
, where&
represents the bitwiseAND
operator.Return the minimum possible sum of the values of the
m
subarraysnums
is divided into. If it is not possible to dividenums
intom
subarrays satisfying these conditions, return-1
.
3116. Kth Smallest Amount With Single Denomination Combination
You are given an integer array
coins
representing coins of different denominations and an integerk
.You have an infinite number of coins of each denomination. However, you are not allowed to combine coins of different denominations.
Return the
kth
smallest amount that can be made using these coins.