say x is the amount of $10 bills and y is the amount of $20 bills
10x+20y=340
x+y=23
you would have to cancel out an x or y so let's cancel out the x
10x+20y=340
-10(x+y=23)
which becomes
10x+20y=340
-10x-10y=230
which equals
0x+10y=110 or y=11
so there are 11 $20 bills...
x+11=23
-11 -11
x=12
which means there are 12 $10 bills
The answer is 11 $20 bills and 12 $10 bills