Let each of them start with x. Then Ahmad receives 180, giving him 180+x. Darryl spends 255, leaving him with x - 255. At this point, Ahmad has 4 times Darryl's money, so the equation is:
(180+x) = 4(x - 255)
180+x = 4x - 1020
1200 = 3x
x = 400
Each of them had $400 at first.