detectSubTreeRows() for the below case fails.
position: 839, numLeaves: 300, forestRows: 9 should result in 5 but detectSubTreeRows() returns 8.
How to calculate the correct position:
- With 300 leaves and 9 rows,
839's parent is 931.
931's parent is 977.
977's parent is 1000, which is a root.
detectRow(1000, 9) returns 5.
However, detectSubTreeRows(1000, 300, 9) returns 8.
Playground:
https://go.dev/play/p/LarcZzajT_3