Publicis Sapient Interview Question

One graphs problem And other is digit dp problem