I'd like your help with understanding , how come the following language is decidable (in $R$):
$L=\{(\langle M \rangle,k)| M$ is a TM and $\exists w\in \sum^*$ such that when $M$ runs on $w$, $M$ visits some state at least $k$ times$\}$
I tried to think of a Turing machine which decides the problem, but I didn't reach to any smart conclusions.