Assume that there are n tyres that could be used by car, tricycle and bicycle. Write a program to accept n tyres and generate all the combinations (i.e. the number) of car(s), tricycle(s) and bicycle(s) that could exhaust the n tyres. Ensure that all the objects have fair share where possible
Fakeyede 0 Newbie Poster
Recommended Answers
Jump to PostConsider a combination
(c,t,b)
withn-4
tyres, if any. Add a car: you get a combination withn
tyres. This covers all combinations having at least one car. It remains to generate the combinations without car. Consider all such combinations withn-3
tyres and add a tricycle. This gives all …
All 4 Replies
Gribouillis 1,391 Programming Explorer Team Colleague
Fakeyede 0 Newbie Poster
Gribouillis 1,391 Programming Explorer Team Colleague
TrustyTony 888 ex-Moderator Team Colleague Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.