curriculum/challenges/english/blocks/project-euler-problems-201-to-300/5900f48b1000cf542c50ff9e.md
The quadtree encoding allows us to describe a $2^N×2^N$ black and white image as a sequence of bits (0 and 1). Those sequences are to be read from left to right like this:
Consider the following 4×4 image (colored marks denote places where a split can occur):
This image can be described by several sequences, for example : "<strong><span style="color: red">0</span></strong><strong><span style="color: blue">0</span></strong>10101010<strong><span style="color: green">0</span></strong>1011111011<strong><span style="color: orange">0</span></strong>10101010", of length 30, or "<strong><span style="color: red">0</span></strong>10<strong><span style="color: green">0</span></strong>101111101110", of length 16, which is the minimal sequence for this image.
For a positive integer $N$, define $D_N$ as the $2^N×2^N$ image with the following coloring scheme:
What is the length of the minimal sequence describing $D_{24}$?
quadtreeEncoding() should return 313135496.
assert.strictEqual(quadtreeEncoding(), 313135496);
function quadtreeEncoding() {
return true;
}
quadtreeEncoding();
// solution required