Remix.run Logo
alkyon 4 days ago

Obviously 1000 rats is a wrong solution, you could remove one and still get the answer. But we could get better than that when you think about a thousand as three dimensional cube (10^3). Treating a rat with just one layer of the cube we could optimize to 30 rats. At this point I looked the answer they suggested and it was 10 (binary representation). Obviously one can construct a mulitdimensional cube with just two as a base - 2^10 and then its 20 rats. But know I realized I forgot the very first optimization I mentioned here that you could just use 1000-1 rat in the first place. So it will be fine with just (2-1)x10 rats (and 30-3=27 rats in the case of plain 3-dimensional cube).

alkyon 4 days ago | parent [-]

https://www.geeksforgeeks.org/aptitude/puzzle-19-poison-and-...