Challenge Active

The Weekly Challenge

You don't have   to be an   expert

The Weekly Challenge
Task #1 Alphabet Index Digit Sum

You are given a string $str consisting of lowercase English letters, and an integer $k. Write a script to convert a lowercase string into numbers using alphabet positions (a=1 … z=26), concatenate them to form an integer, then compute the sum of its digits repeatedly $k times, returning the final value.

Task #2 Valid Token Counter

You are given a sentence. Write a script to split the given sentence into space-separated tokens and count how many are valid words. A token is valid if it contains no digits, has at most one hyphen surrounded by lowercase letters, and at most one punctuation mark (!, ., ,) appearing only at the end.

Design Patterns in Modern Perl
📖 New Book by Mohammad Sajid Anwar

Design Patterns in Modern Perl

Classic object-oriented patterns in today's Perl — using core Perl, Moo and Object::Pad. Cleaner, more maintainable code.

View Book →

SO WHAT DO YOU THINK ?

If you have any suggestions or ideas then please do share with us.

Contact with me