The platform is 400 meters long.
Let the length of first Train be T. So, the length of the second train is 0.5T. Let the length of the platform be P.
The first train has to travel a distance of 1.5T in order to cross the oncoming train. The effective speed is 48 + 42 KMPH = 90 KMPH = 90,000/3,600 = 25 meters per sec. If it travels 1.5 T meters in 12 seconds at 25 meters per second, T = 12*25/1.5 = 200 meters.
In order to cross the platform fully, the train has to travel a distance of T+P meters. If that is accomplished in 45 seconds at the speed of 48 KMPH, (T+P)/45 = 48,000/3600. T+P = 48,000*45/3,600 = 600. As T= 200, P = 600-200 = 400 m.