Submitted by: Mohammad Sajid Anwar
You are given two array of strings.
Write a script to return the number of strings that appear exactly once in each of the two given arrays. String comparison is case sensitive.
Input: @array1 = ("apple", "banana", "cherry")
@array2 = ("banana", "cherry", "date")
Output: 2
Input: @array1 = ("a", "ab", "abc")
@array2 = ("a", "a", "ab", "abc")
Output: 2
"a" appears once in @array1 but appears twice in @array2, therefore, not counted.
Input: @array1 = ("orange", "lemon")
@array2 = ("grape", "melon")
Output: 0
Input: @array1 = ("test", "test", "demo")
@array2 = ("test", "demo", "demo")
Output: 0
Input: @array1 = ("Hello", "world")
@array2 = ("hello", "world")
Output: 1
String comparison is case sensitive.
Submitted by: Mohammad Sajid Anwar
You are given a number and a digit (k).
Write a script to find the K-Beauty of the given number. The K-Beauty of an integer number is defined as the number of substrings of given number when it is read as a string has length of 'k' and is a divisor of given number.
Input: $num = 240, $k = 2
Output: 2
Substring with length 2:
24: 240 is divisible by 24
40: 240 is divisible by 40
Input: $num = 1020, $k = 2
Output: 3
Substring with length 2:
10: 240 is divisible by 10
02: 240 is divisible by 2
20: 240 is divisible by 20
Input: $num = 444, $k = 2
Output: 0
Substring with length 2:
First "44": 444 is not divisible by 44
Second "44": 444 is not divisible by 44
Input: $num = 17, $k = 2
Output: 1
Substring with length 2:
17: 17 is divisible by 17
Input: $num = 123, $k = 1
Output: 2
Substring with length 1:
1: 123 is divisible by 1
2: 123 is not divisible by 2
3: 123 is divisible by 3
Last date to submit the solution 23:59 (UK Time) Sunday 24th May 2026.