Since the acceleration is constant we know that it is given by:

from where we have that:

once we have this equation we can determine the time by plugging the values of the acceleration and velocities.
a)
In this case we have that:

Therefore it takes 2.67 s.
b)
In this case we have that:

Therefore it takes 2.67 s.