Added solution for 2.2 (in TeX and as code)