Let's denote the number of hours worked as \( h \).
Leila's total amount of money after working \( h \) hours can be calculated as follows:
\[ \text{Leila's total amount} = \text{initial savings} + \text{earnings} = 30 + 4h \]
Mark's total amount of money after working \( h \) hours can be calculated as:
\[ \text{Mark's total amount} = \text{initial savings} + \text{earnings} = 5 + 5h \]
We want to find the value of \( h \) when their total amounts are equal:
\[ 30 + 4h = 5 + 5h \]
To solve for \( h \), we first subtract \( 4h \) from both sides:
\[ 30 = 5 + h \]
Next, we subtract 5 from both sides:
\[ 30 - 5 = h \] \[ 25 = h \]
Therefore, after 25 hours, Leila and Mark will have the same amount of money.