22. Java Regex2 - Duplicate words - Java |Strings | Hackerrank

Опубликовано: 07 Июль 2018
на канале: GeeksByte
15,642
122

In this challenge, we use regular expressions (RegEx) to remove instances of words that are repeated more than once, but retain the first occurrence of any case-insensitive repeated word. For example, the words love and to are repeated in the sentence I love Love to To tO code. Can you complete the code in the editor so it will turn I love Love to To tO code into I love to code?

To solve this challenge, complete the following three lines:

Write a RegEx that will match any repeated word.
Complete the second compile argument so that the compiled RegEx is case-insensitive.
Write the two necessary arguments for replaceAll such that each repeated word is replaced with the very first instance the word found in the sentence. It must be the exact first occurrence of the word, as the expected output is case-sensitive.
Note: This challenge uses a custom checker; you will fail the challenge if you modify anything other than the three locations that the comments direct you to complete. To restore the editor's original stub code, create a new buffer by clicking on the branch icon in the top left of the editor.


На этой странице сайта вы можете посмотреть видео онлайн 22. Java Regex2 - Duplicate words - Java |Strings | Hackerrank длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь GeeksByte 07 Июль 2018, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 15,642 раз и оно понравилось 122 зрителям. Приятного просмотра!