Suppose I have #x# notes of Rs.#5# denomination, #y# notes of Rs.#10# denomination and then we have #45-x-y# notes of denomination Rs.#20#.
As total number of #5# and #10# rupee notes is #15# more than the number of #20# rupee notes, we have #x+y=(45-x-y)+15#
or #x+y=60-x-y# or #2x+2y=60# or #x+y=30# or #y=30-x#
Hence we have #x# notes of Rs.#5# denomination, #30-x# notes of Rs.#10# denomination and then we have #45-x-y=45-x-(30-x)=15# notes of denomination Rs.#20#.
And their value is #5x+10xx(30-x)+15xx20=5x+300-10x+300=600-5x#
and #600-5x=500# i.e. #5x=600-500=100# and #x=100/5=20#
Hence, I have #20# notes of Rs.#5# denomination, #10# notes of Rs.#10# denomination and #15# notes of denomination Rs.#20#.