Grokking the Coding Interview: Patterns for Coding Questions
Ask Author
Back to course home

0% completed

Vote For New Content
Lining Wang
More space-saving solution

Lining Wang

Nov 1, 2023

The right suffix array doesn't need to be calculated since you can calculate the total of all elements once, subtract the left suffix, and the current element to get the right suffix value.

2

0

Comments
Comments
cyril gorrieri
cyril gorrieri2 years ago

That's also how I solved the problem

On this page