First we'll try to find positions or relative positions of $1, 2, 3, 4, 5$ and for remaining numbers, we'll see what can be done with them later.
Sum (inclusive) of numbers lying between $4 \text{ and }5 = 45$.
$\sum_{i=1}^{9} i = \frac{9(9+1)}{2} = 45$.
$\therefore 4,5$ must be in extreme corners.
Sum (exclusive) of numbers lying between $4 \text{ and }5 = 45 - 4 - 5 = 36$.
$[4, sum(36), 5]$.
Sum (inclusive) of numbers lying between $3 \text{ and }4 = 34$.
Sum (exclusive) of numbers lying between $3 \text{ and }4 = 34 - 3 - 4 = 27$.
Sum (exclusive) of numbers lying between $3 \text{ and }5 = 45 - 34 - 5 = 6$.
$[4, sum(27), 3, sum(6), 5]$.
Sum (inclusive) of numbers lying between $2 \text{ and }3 = 23$.
Sum (exclusive) of numbers lying between $2 \text{ and }3 = 23 - 2 - 3 = 18$.
Sum (exclusive) of numbers lying between $2 \text{ and }4 = 34 - 23 - 4 = 7$.
$[4, sum(7), 2, sum(18), 3, sum(6), 5]$.
Sum (inclusive) of numbers lying between $1 \text{ and } 2 = 12$.
Sum (exclusive) of numbers lying between $1 \text{ and } 2 = 12 - 1 - 2 = 9$.
Sum (exclusive) of numbers lying between $1 \text{ and } 3 = 23 - 12 - 3 = 8$.
$[4, sum(7), 2, sum(9), 1, sum(8), 3, sum(6), 5]$.
$\therefore$ possible permutations are -
$4, 7, 2, 9, 1, 8, 3, 6, 5 \text{ and } 5, 6, 3, 8, 1, 9, 2, 7, 4$.
Answer :- 2.