Popular interview question:
Given an array of positive integers and a target integer, find if there is a consecutive subarray that sums to the target.
E.g.
Array = [1,3,6,7,8,10]
Target = 16
The subarray that sums to 16 is [3,6,7]
, so it returns true.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…