Submitted by: Mohammad Sajid Anwar
You are given a string, $str
, containing lowercase English letters only.
Write a script to print the first letter that appears twice.
Input: $str = "acbddbca"
Output: "d"
Input: $str = "abccd"
Output: "c"
Input: $str = "abcdabbb"
Output: "a"
Submitted by: Mohammad Sajid Anwar
You are given a string, $str
, where every two consecutive vertical bars are grouped into a pair
.
Write a script to return the number of asterisks, *
, excluding any between each pair of vertical bars.
Input: $str = "p|*e*rl|w**e|*ekly|"
Ouput: 2
The characters we are looking here are "p" and "w**e".
Input: $str = "perl"
Ouput: 0
Input: $str = "th|ewe|e**|k|l***ych|alleng|e"
Ouput: 5
The characters we are looking here are "th", "e**", "l***ych" and "e".
Last date to submit the solution 23:59 (UK Time) Sunday 4th August 2024.