Hello Ananya ,
let it be X years ago when sindhu was 3 times smithas age
So sindhu was 40-X and smita was 20-X years of age back then
Then (40 - x) = 3 ( 20-x)
40 = 60 - 3x + x
2x = 20
x = 10
So 10 years ago ie.. when sindhu was 40-10 = 30 years and smitha was 20 -10 = 10 years of age