Submitted by: Mohammad Sajid Anwar
You are given two arrays of strings.
Write a script to return true if the two given array represent the same strings otherwise false.
Input: @arr1 = ("a", "bc")
@arr2 = ("ab", "c")
Output: true
Array 1: "a" + "bc" = "abc"
Array 2: "ab" + "c" = "abc"
Input: @arr1 = ("a", "b", "c")
@arr2 = ("a", "bc")
Output: true
Array 1: "a" + "b" + "c" = "abc"
Array 2: "a" + "bc" = "abc"
Input: @arr1 = ("a", "bc")
@arr2 = ("a", "c", "b")
Output: false
Array 1: "a" + "bc" = "abc"
Array 2: "a" + "c" + "b" = "acb"
Input: @arr1 = ("ab", "c", "")
@arr2 = ("", "a", "bc")
Output: true
Array 1: "ab" + "c" + "" = "abc"
Array 2: "" + "a" + "bc" = "abc"
Input: @arr1 = ("p", "e", "r", "l")
@arr2 = ("perl")
Output: true
Array 1: "p" + "e" + "r" + "l" = "perl"
Array 2: "perl"
Submitted by: Mark Anderson
You are given a list and a non-negative integer.
Write a script to divide the given list into given non-negative integer equal parts. Return -1 if the integer is more than the size of the list.
Input: @list = (1,2,3,4,5), $n = 2
Output: ((1,2,3), (4,5))
5 / 2 = 2 remainder 1.
The extra element goes into the first chunk.
Input: @list = (1,2,3,4,5,6), $n = 3
Output: ((1,2), (3,4), (5,6))
6 / 3 = 2 remainder 0.
Input: @list = (1,2,3), $n = 2
Output: ((1,2), (3))
Input: @list = (1,2,3,4,5,6,7,8,9,10), $n = 5
Output: ((1,2), (3,4), (5,6), (7,8), (9,10))
Input: @list = (1,2,3), $n = 4
Output: -1
Input: @list = (72,57,89,55,36,84,10,95,99,35), $n = 7;
Output: ((72,57), (89,55), (36,84), (10), (95), (99), (35))
Last date to submit the solution 23:59 (UK Time) Sunday 10th May 2026.