An integer between $1000$ and $9999,$ inclusive, is called balanced if the sum of its two leftmost digits equals the sum of its two rightmost digits. How many balanced integers are there?
For each sum $s$, the first two digits ($a\ge1$) can be chosen in $f(s)$ ways and the last two in $g(s)$ ways: $f(s)=s$, $g(s)=s+1$ for $s\le9$, and $f(s)=g(s)=19-s$ for $s\ge10$.
An integer between $1000$ and $9999,$ inclusive, is called lopsided if the sum of its two leftmost digits is exactly $2$ more than the sum of its two rightmost digits. How many lopsided integers are there?