The time needlessly spent in hospital by patients who are medically fit to leave has been cut by almost a third across Lancashire and South Cumbria in the last two years.