Submitted by: Mohammad Sajid Anwar
You are given an array of words and a string (contains only lowercase English letters).
Write a script to return the number of words in the given array that are a prefix of the given string.
You are given an array of words and a string (contains only lowercase English letters).
Write a script to return the number of words in the given array that are a prefix of the given string.
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.
You are given a string formed by digits and #.
Write a script to map the given string to English lowercase characters following the given rules.
You are given a string.
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.
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 times.
You are given an integer (<= 100).
Write a script to return Zeckendorf Representation of the given integer.
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.
| # The Weekly Challenge - 358 | |
| ##### Early Bird Club members ONLY | |
| ## Task 1: Max Str Value | |
| ##### **Submitted by:** [Mohammad Sajid Anwar](https://manwar.org) | |
| You are given an array of alphanumeric string, `@strings`. | |
| Write a script to find the max value of alphanumeric string in the given array. The numeric representation of the string, if it comprises of digits only otherwise length of the string. |
Write a function that takes a 4-digit integer and returns how many iterations are required to reach Kaprekar's constant (6174). For more information about Kaprekar's Constant please follow the wikipedia page.
manwar@manwar:~/github/manwar.org/public/stats$ gen-adopted-dist | jq --sort-keys --indent 4 '.' > adopted-distributions.json
manwar@manwar:~/github/manwar.org/public/stats$ gen-personal-dist a d | jq --sort-keys --indent 4 '.' > pd-a-d.json
manwar@manwar:~/github/manwar.org/public/stats$ gen-personal-dist e z | jq --sort-keys --indent 4 '.' > pd-e-z.jsonUpdate year manually in the file: