Question: Question Consider the following function which checks three characters at a time to see if they are the same. check3:.String > Bool check3 = False
Question

Consider the following function which checks three characters at a time to see if they are the same. check3:.String > Bool check3 = False check3 (x:y:z:zs) x==y \& \& y==z= True |otherwise = check 3 zs This function will cause a runtime error on certain input, why is this? a. x is not compared directly to z causing a runtime error. b. The function will fail on list lengths not divisible by 3 unless it encounters 3 identical elements in a row first. c. The otherwise case does not have the correct return type for certain inputs
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
