Question: Please solve this USING F# A list xs : int list is well-bracketed if both of the following are true: For each n, the sum
Please solve this USING F#

A list xs : int list is well-bracketed if both of the following are true: For each n, the sum of the first n elements of xs is non-negative. The sum of all of the elements of xs is zero. Write a function isBracketed : int list -> bool that checks whether a list is well-bracketed. > isBracketed []; ; val it : bool = true > isBracketed [1;-1;1;2;-3] ;; val it : bool = true > isBracketed [1;-2;2; -1]; ; val it : bool = false > isBracketed [1;1;-2;3;-2] ;; val it : bool = false
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
