Task 1: "Common Factors You are given 2 positive numbers $M and $N. Write a script to list all common factors of the given numbers. Example 1: Input: $M = 12 $N = 18 Output: (1, 2, 3, 6) Explanation: Factors of 12: 1, 2, 3, 4, 6 Factors of 18: 1, 2, 3, 6, 9 Example 2: Input: $M = 18 $N = 23 Output: (1) Explanation: Factors of 18: 1, 2, 3, 6, 9 Factors of 23: 1 My notes: simple, find factors and then intersect. Task 2: "Interleave String You are given 3 strings; $A, $B and $C. Write a script to check if $C is created by interleave $A and $B. Print 1 if check is success otherwise 0. Example 1: Input: $A = "XY" $B = "X" $C = "XXY" Output: 1 EXPLANATION "X" (from $B) + "XY" (from $A) = $C Example 2: Input: $A = "XXY" $B = "XXZ" $C = "XXXXZY" Output: 1 EXPLANATION "XX" (from $A) + "XXZ" (from $B) + "Y" (from $A) = $C Example 3: Input: $A = "YX" $B = "X" $C = "XXY" Output: 0 My notes: It's not quite clear what "interleaving" means here, but I'm going to assume that it means "take a PREFIX of any length from one string, followed by a PREFIX of any length from the other string, then continue with the parts of the strings not yet consumed". Relatively easy.