| 367-2 |
Write a script to find out if there is a conflict between the two events. |
constant, map, array references, ref, postfix if |
| 367-1 |
Write a script to rearrange the bits in such a way that the resulting binary number is the maximum odd binary number and return the resulting binary string. |
die, grep |
| 366-2 |
Write a script to return the count different ways we can make it a valid time. |
C-style, Perl-style, postfix if |
| 366-1 |
Write a script to return the number of words in the given array that are a prefix of the given string. |
array reference |
| 365-2 |
Write a script to split the given sentence into space-separated tokens and count how many are valid words. |
grep, split, scalar, regex |
| 365-1 |
Write a script to convert a lowercase string into numbers. |
join, map, ord, split, constant |
| 364-2 |
Write a script to interpret the given string using Goal Parser. |
regex |
| 364-1 |
Write a script to map the given string to English lowercase characters following given rules. |
Transliteration, regex, e modifier, chr |
| 363-1 |
Write a script that parses a self-referential string and determines whether its claims about itself are true. The string will make statements about its own composition, specifically the number of vowels and consonants it contains. |
split, map, word_to_number, extract data, ternary operator |
| 362-2 |
You are given an array of integers. Write a script to return them in alphabetical order, in any language of your choosing. Default language is English. |
Schwartzian Transform, Lingua::Any::Numbers, sort, cmp |
| 362-1 |
You are given a string containing lowercase letters. Write a script to transform the string based on the index position of each character (starting from 0). For each character at position i, repeat it i + 1 time |
for, map, join, substr |
| 360-2 |
You are give a sentence. Write a script to order words in the given sentence alphabetically but keeps the words themselves unchanged. |
join, grep, sort, cmp, split |
| 360-1 |
You are given a string and a width. Write a script to return the string that centers the text within that width using asterisks * as padding. |
String::Pad qw(pad) |
| 359-2 |
You are given a word containing only alphabets, Write a function that repeatedly removes adjacent duplicate characters from a string until no adjacent duplicates remain and return the final word. |
split, substr |
| 359-1 |
Write a function that calculates the additive persistence of a positive integer and also return the digital root. |
split |
| 358-2 |
Encrypt a string using a Caesar cipher shift by rotating letters through the alphabet. |
chr, ord, join, split, |
| 358-1 |
Find the maximum alphanumeric value in an array by treating numeric strings as numbers and others by length. |
regex |
| 353-1 |
return the maximum number of words that appear in a single sentence. |
List::Util qw(max), map, scalar, split |
| 348-1 |
Check if a string of even length can be split into two halves with equal non-zero vowel counts. |
substr, transliteration, shift |
| 340-1 |
Repeatedly remove adjacent duplicate letters from a string until no more duplicates remain. |
do-while, regex |
| 320-1 |
Return the larger count between positive and negative integers in an array, ignoring zeros. |
foreach, ternary operator |
| 319-1 |
Count words in an array that either start with or end with a vowel. |
grep, regex |
| 317-1 |
Return true if the first letters of words in an array form a given acronym. |
join, map, eq |
| 310-1 |
Convert uppercase letters to lowercase and lowercase letters to uppercase in a string. |
tr operator (transliteration) |
| 308-1 |
Count common strings between two arrays. |
nested loops |
| 301-1 |
Arrange positive integers to form the largest possible concatenated number. |
regex, join, sort, cmp |
| 289-1 |
Find the third distinct maximum number in an array, or return the maximum if fewer than three distinct values exist. |
hash, sort, scalar |
| 284-1 |
Find the lucky integer in an array where the frequency equals its value, returning the largest if multiple. |
Statistics::Frequency, grep, sort, ternary operator |
| 283-1 |
Find the unique element in an integer array where all other elements appear more than once. |
grep, hash |
| 282-2 |
Count the number of times a user must change the key while typing a string, ignoring shifts and caps locks. |
transliteration (squeeze option) |
| 280-1 |
Print the first letter in a string that appears twice. |
hash, split |
| 279-2 |
Split a string into two parts with equal vowel counts and indicate if possible. |
transliteration, ternary operator |
| 278-1 |
Reassemble a shuffled string where each word contains a number for original position. |
join, map, regex, sort, substr, split |
| 277-1 |
Count words that appear exactly once in both string arrays. |
List::Compare, grep, scalar |
| 276-1 |
Count the number of pairs in an array that form a complete day (sum is a multiple of 24 hours). |
Math::Combinatorics |
| 275-2 |
Replace each digit in an alphanumeric string with the value of the previous letter plus the digit. |
split, chr, ord |
| 270-2 |
Find all substrings of a string that start and end with a vowel. |
string processing, substrings, vowels, regex |
| 270-1 |
Calculate the factorial of a number using recursion or iteration. |
factorial, recursion, iteration, mathematical computation |
| 268-2 |
Number game |
List::MoreUtils qw(natatime), reverse, join, push |
| 268-1 |
Magic Number |
nested loops |
| 267-2 |
Line Count |
split, ord |
| 267-1 |
Find the sign of product of all integers in the given array. |
grep, modulo |
| 265-2 |
Completing Word |
Statistics::Frequency, scalar, sort, join, regex, nested loops |
| 265-1 |
Write a script to find an integer in the given array that appeared 33% or more |
Statistics::Frequency, hash, sort |
| 264-2 |
Merge two arrays into a new array that satisfy specific conditions |
substr, split |
| 264-1 |
Write a script to return the greatest English letter in the given string. |
index, push, sort |
| 263-2 |
Merge items of 2D array. |
substr, hash, sort |
| 263-1 |
Return the list of indices in the sorted array where the element is same as the given target element. |
join, grep, sort |
| 262-2 |
Count or identify pairs of elements in an array that satisfy specific conditions on their values and/or positions. |
nested for loop |
| 262-1 |
Return the maximum number of either positive or negative integers in the given array |
scalar, grep, ternary operator |
| 261-1 |
Evaluate the absolute difference between element and digit sum of the given array. |
split, join, abs |
| 260-1 |
Determine if the number of occurrences of each array value is unique. |
hash |
| 258-1 |
Write a script to find out how many integers have even number of digits. |
scalar, grep, regex |
| 255-1 |
Compare two strings and find the additional character |
regex, split |
| 239-1 |
Write a script to find out if the word created by concatenating the array elements is the same. |
array comparison, join |
| 208-2 |
Write a script to determine: the duplicated value, and the missing value (if any), in an array of integers. |
hash, grep, push |
| 208-1 |
Write a script to find out all common strings in the given two arrays with minimum index sum. |
push, grep, function pipeline, array reference |
| 201-1 |
Given an array of unique numbers. Write a script to find out all missing numbers in the range 0..$n where $n is the array size. |
has, push, map, grep |
| 190-1 |
Write a script to find out if the usage of Capital is appropriate, satisfying specific rules. |
regex |
| 186-1 |
Merge the two lists in a specific way. |
map, loop, input validation, array reference |
| 184-1 |
Write a script to replace the first two characters with sequence starting with '00', '01', '02'. |
sprintf, substr, validation, array reference |
| 182-1 |
Write a script to find the index of the first biggest number in the list. |
rarray reference |
| 180-1 |
Write a script to find out the first unique character in the given string and print its index (0-based). |
split, substr, hash |
| 173-1 |
You are given a positive integer, $n. Write a script to find out if the given number is Esthetic Number. |
split, substr, validation, abs |
| 163-1 |
Sum Bitwise Operator |
bit operator, array reference |
| 157-1 |
Pythagorean Means |
round, scalar, array reference |
| 145-1 |
Write a script to implement Dot Product. |
regex, validation |
| 139-1 |
Write a script to implement JortSort. |
array reference |
| 117-1 |
You are given text file with rows numbered 1-15 in random order but there is a catch one row in missing in the file. |
split, grep, hash |
| 106-1 |
Write a script to display the maximum difference between two successive elements once the array is sorted. |
sort, for |
| 096-1 |
Reverse words |
regex, reverse, split |
| 095-1 |
Palindrome Number |
scalar, reverse |
| 086-1 |
Given an integer array @N and an integer $A, determine whether any pair of elements has a difference equal to $A. |
hash, grep |
| 083-1 |
Write a script to find the length of the string except the first and last words ignoring whitespace. |
regex, shift, pop, join |
| 045-1 |
Square Secret Code |
regex, for |
| 033-1 |
Create a script that counts the number of times letters appeared in a string. |
hash, for |
| 032-1 |
Count instances and then print a summary, sorted by the count of each entry. |
hash, <DATA> |
############
| 029-1 |
Write a script to demonstrate brace expansion. |
split, regex, push |
| 020-1 |
Write a script that splits a string on change of character. |
split, regex, join, push, for, while |
| 002-1 |
Write a script or one-liner to remove leading zeros form positive numbers. |
regex |