
Data Science Interview
0 of 257 Completed
Introduction
1m read
Basic Data Types
6m read
Iterables
6m read
Functions and Classes
5m read
Find the Missing Number
Question
Find Bigrams
Question
Merge Sorted Lists
Question
Permutation Palindrome
Question
Equivalent Index
Question
Equivalent Index
Given a list of integers, find the index at which the sum of the left half of the list is equal to the right half.
If there is no index where this condition is satisfied return -1.
Example 1:
Input:
nums = [1, 7, 3, 5, 6]
Output:
equivalent_index(nums) -> 2
Example 2:
Input:
nums = [1,3,5]
Output:
equivalent_index(nums) -> -1
0%
CompletedYou have 257 sections remaining on this learning path.
Loading pricing options..