candy_count_test, a C code which calls candy_count(), which counts the types of candy in a rectangular container, which might be a vector, matrix, or 3D box. The candy is assumed to have C possible types, and to have been entered into the container in a cycle that begins with type 1. While the vector case is easy, it is already difficult to come up with a general formula for the MxN matrix case.
The information on this web page is distributed under the MIT license.
candy_count, a C code which counts the types of candy in a rectangular container, which might be a vector, matrix, or 3D box. The candy is assumed to have C possible types, and to have been entered into the container in a cycle that begins with type 1. While the vector case is easy, it is already difficult to come up with a general formula for the MxN matrix case.