Synopsys Interview Question

tree problem that i had to solve using appropriate programming language general overall question of systemverilog knowledge combinatorics question