Answer
See the detailed answer below.
Work Step by Step
$$\color{blue}{\bf [a]}$$
According to the right-hand rule, the thumb finger is toward the current, the index finger is toward the magnetic field, and the middle finger is toward the force, the direction of the current had to be into the page.
$$\color{blue}{\bf [b]}$$
The rails are frictionless, so the only force exerted on the bar is the magnetic force toward the right.
$$F_B=BIL=ma$$
Hence, the bar's acceleration is given by
$$a=\dfrac{BIL}{m}\tag 1$$
Now we can use the kinematic formula of
$$v^2=v_i^2+2as=0+2ad$$
where $s=d$ at the end of the rails.
$$v =\sqrt{2ad}$$
Plugging from (1),
$$\boxed{v =\sqrt{ \dfrac{2BILd}{m}}}$$