Finding median of a sorted array - LC 4

Hi everyone,
I was looking at the solution for this at this link:

I’m confused by the reasoning behind the choice of indices in the binary search:

I understand that looking for the median number of the arrays is like looking for the (len1 + len2) // 2 th number, but how does that translate to checking the midpoint of the first array against index [(len1 + len2) // 2] - midpoint in the second array?

Thanks to anyone that took the time to look at the code :slight_smile: