- my intuition for this problem was incorrect / bad so i will be omitting it here
π‘ Explanation of Solution
1. track frequency of zeros and ones
2. optimal split calculation (best)
- the variable `best` keeps track of the maximum difference between zeros and ones up to any split point
- this difference helps maximise the score after adding the count of 1s to the right part
3. final adjustment (best + ones)
- after completing the loop iteration, best represents the optimal score contribution from the left part
- to compute the final score, we add all remaining 1s from the right part, to best