Problem · Array
Determine Dice Outcomes (For L4 :)
You are given two N-sided dice, P and Q, where each die has N integer values (not necessarily unique or standard).
When rolled, each side is equally likely to appear.
Given the values on each side of dice P and Q, determine:
P and Q are always in non-decreasing sorted order.
Examples
01 · Example 1
P = [1, 2, 4] Q = [2, 2, 5] return = [-0, -0, -0]
Hello -
Example output is just a placeholder to let the system not complain about missing output :)
public int[] determineDiceOutcomes(int[] P, int[] Q) {
// write your code here
}
P[1, 2, 4]
Q[2, 2, 5]
expected[-0, -0, -0]
sign in to submit