Determine Whether a Target-Sum Subarray Exists

Given an integer array nums and an integer target, determine whether there exists a non-empty contiguous subarray whose elements sum exactly to target.

Although the original prompt mentions...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: