Task 1: "Merge Intervals Write a script to merge the given intervals whereever possible. [2,7], [3,9], [10,12], [15,19], [18,22] The script should merge [2, 7] and [3, 9] together to return [2, 9]. Similarly it should also merge [15, 19] and [18, 22] together to return [15, 22]. The final result should be something like below: [2, 9], [10, 12], [15, 22] " My notes: Fine, but why wouldn't we also merge [2,9] and [10,12] to give [2,12]? I think we would. The immediate thought to implement this is to collapse all ranges to an integer set, and then reconstruct the minimal sequence of ranges direct from the set. Task #2: "Noble Integer You are given a list, @L, of three or more random integers between 1 and 50. A Noble Integer is an integer N in @L, such that there are exactly N integers greater than N in @L. Output any Noble Integer found in @L, or an empty list if none were found. An interesting question is whether or not there can be multiple Noble Integers in a list. For example, Suppose we have list of 4 integers [2, 6, 1, 3]. Here we have 2 in the above list, known as Noble Integer, since there are exactly 2 integers in the list greater than 2: 3 and 6. Therefore the script would print 2. " My notes: Interesting, especially the question about "whether or not there can be multiple Noble Integers in a list": If repeated numbers are allowed, you can definitely have multiple (identical) noble numbers eg 2 1 1 1 1... (each 1 is noble because there's exactly one number >1 (the 2)). So disallow that. Now, given distinct numbers, I don't think multiple noble numbers are possible in one list. "find a list with 2 numbers greater than 2 and 3 numbers greater than 3" is not possible, because every number greater than 3 is ALSO greater than 2, so there are at least as many numbers greater than 2 as there are numbers greater than 3, i.e. at least 3 numbers in the list are greater than 2, which contradicts the specification that only (exactly) 2 numbers in the list are greater than 2.