Solved fourth and fifth brain teaser.

4. Function receives string S and looks for integers in it. It returns
the sum of all the numbers in the string and skips all the words. For
example for string "3 little piggies had 10 other friends." function
should return 3+10 = 13.

5. Function receives a string which represents text. Function should
create an array of distinct words in the text by using a reference to a
string array. For example in the text: "This is the first string. This
is the second string." the function should create an array of these
words: [This, is, the, first, string, second]. As the return type,
function returns int which is the number od distinct words.