Could you please let me know is there any better way to write the below to avoid the if and else condition. I have a input structure is below,
results=[ {