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

0% completed

Vote For New Content
Why just 2 indices? Subarrays can be of more elements, can't they?For an array w...

aj

Jun 28, 2022

Why just 2 indices? Subarrays can be of more elements, can't they?

For an array with distinct elements, finding all of its contiguous subarrays is like finding the number of ways to choose two indices, i and j, in the array such that i

1

0

Comments
Comments
Design Gurus
Design Gurus3 years ago

'i' and 'j' are the two indices and the elements from index 'i' to index 'j' will constitute the subarray.

On this page