You are viewing a single comment's thread. Return to all comments →
My interpretation, using the sample input for explanation:
From the sample input, n=6 and m=7.
I'm using array convention, where a[0] is left most value and a[5] is right most value.
a[0] can be any digit from 0 to 9. Same for indices 1 through 5.
Therefore, you can think of the possible values of a as: [0,0,0,0,0,0] all the way to [9,9,9,9,9,9].
Another way to think about this is, we are considering the range of numbers from 0 to (10**n)-1
The number 654321 is in this range. Does 654321 fit all m requirements? m={(1 3),(0 1),(2 4),(0 4),(2 5),(3 4),(0 2)}
m[1] = (0 1) => requirement that value@index0 <= value@index1
For 654321, value@index0 is 6 and value@index1 is 5.
Therefore, requirement m[1] is not met, so 654321 is not a valid assignment.
Requirement
You are viewing a single comment's thread. Return to all comments →
My interpretation, using the sample input for explanation:
From the sample input, n=6 and m=7.
I'm using array convention, where a[0] is left most value and a[5] is right most value.
a[0] can be any digit from 0 to 9. Same for indices 1 through 5.
Therefore, you can think of the possible values of a as: [0,0,0,0,0,0] all the way to [9,9,9,9,9,9].
Another way to think about this is, we are considering the range of numbers from 0 to (10**n)-1
The number 654321 is in this range. Does 654321 fit all m requirements? m={(1 3),(0 1),(2 4),(0 4),(2 5),(3 4),(0 2)}
m[1] = (0 1) => requirement that value@index0 <= value@index1
For 654321, value@index0 is 6 and value@index1 is 5.
Therefore, requirement m[1] is not met, so 654321 is not a valid assignment.