hey, your attempt is nearly correct.
You mixed up the length of the ladder and the height of the house/the reach of the ladder, otherwise the ladder would get longer the further away it is from the wall it's leaning on.
The length of the ladder (4.2m) is your diagonal=c
1.3m=b
a²+b²=c²
a²+1.3²=4.2²
a²+1.69=17.641
a²=17.641-1.69
a²=15,951≈16
a=3.9939≈4