Apollys
Apollys
I think this is a major hole in this formatter. One of the primary reasons I started using this was so that it could handle this kind of tedious manual...
> If we end up merging 2, 4, 8, 16, ... cells, I suspect it will be O(n * log n) ? This is since we have to update "region_id_matrix"....
Remember what I wrote: > For a two-region merge, the time complexity is O(size of smaller region) We don't rewrite the region id's of the largest region!
I see what you're getting at - applying the knapsack DP idea to this scenario. The complexity analysis and optimal algorithm design gets a little trickier with negative numbers permitted....