Formal charge = Total number of valence electrons in the free atom - [ Total number of non-bonding (lone pair)electrons ] −21​ [ Total number of bonding (shared) electrons ]
on..... the end N atom marked 1 . =5−4−21​(4)=5−4−2=−1 the central N atom marked 2 , =5−0−21​(8)=5−4=+1 the end O atom, =6−4−21​(4)=6−6=0