Ezvor

1868. Product of Two Run-Length Encoded Arrays

MediumArray Preparing judge… LeetCode
ArrayTwo Pointers

Hints

Hint 1
Keep track of the indices on both RLE arrays and join the parts together.
Hint 2
What is the maximum number of segments if we took the minimum number of elements left on both the current segments every time?