How can I solve this problem
Have you googled Arduino IR AC? Controlling an A/C with an Arduino with IR appears to be a notoriously difficult proposition. Controlling a TV is simple, because TV manufacturers have agreed on standards defining the protocols and how many times the data needs to be sent (once). Not so with AC manufacturers.