The numbers of cells connected in one direction are (n−m) and the numbers of cells connected in reverse direction are m.
The net potential is given as,
V=(n−m)E−mE
=(n−2m)E
Since the resistance of the circuit is R.
The current in the circuit is given as,
i=(n−2m)ER