Grokking Data Structures & Algorithms for Coding Interviews
Ask Author
Back to course home

0% completed

Vote For New Content
Rafael Scarduelli
The Python solution breaks for an empty array

Rafael Scarduelli

Feb 22, 2024

This happens on line 4 when trying to get nums[0].

0

0

Comments
Comments
Design Gurus
Design Gurusa year ago

Given the problem constraints, you should expect at least one element in the input array:

1 <= nums.length <= 1000

On this page

Problem Statement

Examples

Solution

Step-by-step Algorithm

Algorithm Walkthrough

Code

Complexity Analysis

Time Complexity

Space Complexity