Publicis Sapient interview question

One graphs problem And other is digit dp problem