edit bridge dp explanation