Challenge: Command Pattern

In this challenge, you have to implement the command pattern to solve the given problem.

Problem statement

Study and run the code snippet below:

Level up your interview prep. Join Educative to access 70+ hands-on prep courses.