Yahoo Interview Question
Software Engineer / Developers0 1 2 3 4 5
0 1 2 6 7 8
represent 9 as inverted figure of 6 that way you can show all the days of a month
How about 0123789
123456
You can represent any number from 1-30 without using so called inversion of 180.
012345789
and
012
Use the nine to invert to a six, and swap the cubes for any day above 29. (ie: only ever 30 or 31).
why many ppl focus on 0 in both cubes, is it necessary,? and 6 to treat as 9.
Simply
cube 1 : 0 1 2 3 4 5
cube 2 : 1 2 6 7 8 9
Yes, 1 2 must both be on both dice, and the rest, of 0 3 4 5 6 7 8 9 can be distributed however is convenient.
012345
- anonymous September 13, 2010012678
(use 6 for both 6 and 9)