The classic method for time and work uses fractions: if A finishes a job in 12 days, A does 1/12 of it each day. That is correct, but adding 1/12 and 1/18 under exam pressure is slow and error-prone. The LCM method removes the fractions by choosing a convenient size for the job.
Take the total work to be the LCM of the given numbers of days. Every worker then completes a whole number of units each day. Add the units of the people working together, divide the total work by that sum, and you have the time.
Total work = LCM of days • Daily units = total work ÷ days • Time = total work ÷ combined daily units