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

Question Consider the following function which checks three characters at a time

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!