My solution was a bit more combinatorial in that I used complementary counting. Also, I used more tree DP instead of summing the DP values from the first half of the official editorial. Here's my submission. Feel free to ask questions.
My solution was a bit more combinatorial in that I used complementary counting. Also, I used more tree DP instead of summing the DP values from the first half of the official editorial. Here's my submission. Feel free to ask questions.