Deloitte Interview Question

Code for pyramid and fibonacci series