Consider the problem 731. My Calendar II. Each of its test cases make some method calls. Currently, we need to input the test cases like:
["MyCalendarTwo","book","book","book","book","book","book"]
[[],[10,20],[50,60],[10,40],[5,15],[5,10],[25,55]]The problem with this approach is that we have to manually find out the arguments of a method call. For example, to find the arguments of the third book(..) call, we need to scan the arguments of all the previous book(...) method calls. This approach consumes a lot of time and effort.
We can solve the problem by combining a method name and its arguments together. For example, the following format does not require any scanning:
[["MyCalendarTwo", ()], ["book", (10, 20)], ["book", (50,60)], ["book", (10,40)], ["book", (5,15)], ["book", (5,10) ], ["book", (25,55)]]