3117. Minimum Sum of Values by Dividing Array
You are given two arrays
numsandandValuesof lengthnandmrespectively.The value of an array is equal to the last element of that array.
You have to divide
numsintomdisjoint contiguous subarrays such that for theithsubarray[li, ri], the bitwiseANDof 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 bitwiseANDoperator.Return the minimum possible sum of the values of the
msubarraysnumsis divided into. If it is not possible to dividenumsintomsubarrays satisfying these conditions, return-1.
3116. Kth Smallest Amount With Single Denomination Combination
You are given an integer array
coinsrepresenting 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
kthsmallest amount that can be made using these coins.