In this challenge, you will reimplement a tiny part of React from scratch! It’s not as hard as it sounds.
Scroll through the sandbox preview. Notice that it shows four test cases. They correspond to the examples you’ve seen earlier on this page. Your task is to implement the getFinalState function so that it returns the correct result for each of those cases. If you implement it correctly, all four tests should pass.