Тёмный

ArrayChallenge 

Codefarmer
Подписаться 46
Просмотров 102
50% 1

Have the function ArrayChallenge(strArr) read the array of strings stored in strArr, which will contain 2 elements: the first element will be a sequence of characters, and the second element will be a long string of comma-separated words, in alphabetical order, that represents a dictionary of some arbitrary length.
For example:
strArr can be: ["hellocat", "apple,bat,cat,goodbye,hello,yellow,why"].
Your goal is to determine if the first element in the input can be split into two words, where both words exist in the dictionary that is provided in the second input.
In this example, the first element can be split into two words: hello and cat because both of those words are in the dictionary. Your program should return the two words that exist in the dictionary separated by a comma. So for the example above, your program should return hello,cat. There will only be one correct way to split the first element of characters into two words. If there is no way to split string into two words that exist in the dictionary, return the string not possible. The first element itself will never exist in the dictionary as a real word. Once your function is working, take the final output string and concatenate it with your ChallengeToken, and then replace every third character with an X.
Your ChallengeToken: pq7kbawue985
Examples
Input: ["baseball", "a,all,b,ball,bas,base,cat,code,d,e,quit,z"]
Output: base,ball
Final Output: baXe,XalXpqXkbXwuX98X
Input: ["abcgefd", "a,ab,abc,abcg,b,c,dog,e,efd,zzzz"]
Output: abcg,efd
Final Output: abXg,XfdXq7XbaXueX85

Наука

Опубликовано:

 

25 авг 2023

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии    
Далее
Working with environment variables flutter
10:37
Просмотров 1,9 тыс.
Schoolboy - Часть 2
00:12
Просмотров 3,5 млн
ЮТУБ ТОЧНО ВСЕ!
11:23
Просмотров 1 млн
Python VS C++
0:29
Просмотров 32 тыс.
Wikipedia(Offline) + llama3.1
3:50
Просмотров 18
Python vs C++ Speed Comparison
1:04
Просмотров 1,9 млн
indian coding tutorials be like
1:40
Просмотров 1,7 млн
3 Rapid-Fire Mountain Bike Tuneups
12:06
Просмотров 114 тыс.
Deep Dive Into Flutter Deep Linking
34:03
Просмотров 1,1 тыс.
Новые iPhone 16 и 16 Pro Max
0:42
Просмотров 2,3 млн