about | help | code help+videos | done | prefs |
Given an input String containing multiple words separated by spaces, return true if the first word occurs again anywhere later in the String (as its own word, or as a series of characters) and false otherwise. HINT I'd recommend the use of indexOf() with both one and two parameters, as well as substring(). Note also that the first word is really just some characters. You don't need to be fancy and assume that it will occur as a whole word later (see the "my army" example).apcsaStringsFirstWordOccursLater("stop in the name of the law") → false apcsaStringsFirstWordOccursLater("I sing and I dance") → true apcsaStringsFirstWordOccursLater("my army") → true ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 150
Copyright Nick Parlante 2017 - privacy