We are told that, 10000 is deposited in bank A for a certain number of years at a simple interest of 5% per annum.
Let us say that the number of years is x
Total value of the deposit after x years is, $10000\left(1+x\left(0.05\right)\right)$
On maturity, the total amount received is deposited in bank B for another 5 years at a simple interest of 6% per annum
Here we know the years and the interest rate,
$10000\left(1+x\left(0.05\right)\right)\left(1+5\left(0.06\right)\right)$
$10000\left(1+\left(0.05\right)x\right)\left(1.3\right)$
Interest received from Bank A is $\left(x\left(0.05\right)\right)10000$
Interest received from Bank B is $0.3\left(10000\left(1+x\left(0.05\right)\right)\right)$
This ratio is given to be 10:13.
$\dfrac{x\left(0.05\right)}{0.3\left(1+x\left(0.05\right)\right)}=\dfrac{10}{13}$
$0.65x=3+0.15x$
$0.5x=3$
$x=6$
Hence the number of years the money was invested in Bank A is 6 years.