September 2021
Intermediate to advanced
504 pages
12h 50m
English
This appendix contains hints and tips to get you thinking in the right direction for the more challenging exercises in this book. Trivial exercises have been omitted from this appendix, but full solutions for all exercises can be found in appendix B.
Try matching on the list’s element type. Consider carefully how you would deal with an empty list.
The same applies here as for exercise 3.1.
Use matching and recursion to solve this problem. Consider all the following scenarios in your solution:
What should the function do if the n argument is 0?
What should it do if the list is empty?
What if the list is not empty and ...
Read now
Unlock full access