Submitted by: Mohammad Sajid Anwar
You are given a string of even length.
Write a script to find out whether the given string can be split into two halves of equal lengths, each with the same non-zero number of vowels.
You are given a string of even length.
Write a script to find out whether the given string can be split into two halves of equal lengths, each with the same non-zero number of vowels.
You are given a date in the form: 10th Nov 2025.
Write a script to format the given date in the form: 2025-11-10 using the set below.
You are given a string containing only ( and ).
Write a script to find the length of the longest valid parenthesis.
You are given an array of integers, @ints.
Find all the peaks in the array, a peak is an element that is strictly greater than its left and right neighbours. Return the indices of all such peak positions.
You are given an array of integers, @ints and an integer, $x.
Write a script to add $x to the integer in the array-form.
You are given a list of numbers.
Find the number that is closest to zero and return its distance to zero.
You are given a string made up of lowercase English letters and digits only.
Write a script to format the give string where no letter is followed by another letter and no digit is followed by another digit. If there are multiple valid rearrangements, always return the lexicographically smallest one. Return empty string if it is impossible to format the string.
You are given a string containing English letters only and also you are given broken keys.
Write a script to return the total words in the given sentence can be typed completely.
| use v5.38; | |
| use Test::More; | |
| package Role; | |
| our %REQUIRES; | |
| sub import ($role, @methods) { | |
| my $target = caller; |
You are given a string, $str, consisting of lowercase English letters.
Write a script to return the final string after all duplicate removals have been made. Repeat duplicate removals on the given string until we no longer can.