Subarray Sum Positive

Programming Interview Medium 5 views
Back to Questions

Problem Description

Consider {x}. Output YES if there exists a subarray with sum exactly S else NO.

Input Format

Line1 n S. Line2 n integers (positive).

Output Format

YES or NO.

Sample Test Case

Input:
5 12 1 2 3 7 5
Output:
YES

Constraints

1

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next