I am not able to solve this please give solution

Please give code for the given problem I am not able to sole

hi @akshat1409 refer