Le devoir m'a pris plus de temps que je ne l'avais prévu.

English Translation

The assignment took me longer than I had expected.

Could someone explain the presence of “ne” here?