1114. Print in Order
Description
public class Foo {
public void first() { print("first"); }
public void second() { print("second"); }
public void third() { print("third"); }
}**Input:** nums = [1,2,3]
**Output:** "firstsecondthird"
**Explanation:** There are three threads being fired asynchronously. The input [1,2,3] means thread A calls first(), thread B calls second(), and thread C calls third(). "firstsecondthird" is the correct output.**Input:** nums = [1,3,2]
**Output:** "firstsecondthird"
**Explanation:** The input [1,3,2] means thread A calls first(), thread B calls third(), and thread C calls second(). "firstsecondthird" is the correct output.ac
Last updated