The answer is 36 hours because of ratios.
The ratio of 4 inches of snowfall every 6 hours is 4/6 and since you are wondering how many hours it will take for 24 inches of snowfall you turn the 4 into 24 but keep it the same (like simplifying but the opposite) and you multiply 4/6 by 6/6 and get 24/36 which is basically 24 inches of snowfall in 36 hours.