subject

JavaScript You are developing a new programming language and currently working on variable names. You have a list of words that you consider to be good and could be used for variable names. All the strings in words consist of lowercase English letters.
A complex variable name is a combination (possibly with repetitions) of some strings from words, written in CamelCase. In other words, all the strings are written without spaces and each string (with the possible exception of the first one) starts with a capital letter.
Your programming language should accept complex variable names only.
You need to check if the variableName is accepted by your programming language.
Example
For words = ["is", "valid", "right"] and variableName = "isValid", the output should be camelCaseSeparation(words, variableName) = true.
As variableName consists of words "is" and "valid", and both of them are in words.
For words = ["is", "valid", "right"] and variableName = "IsValid", the output should be camelCaseSeparation(words, variableName) = true.
Note that both variants: "IsValid" and "isValid" are valid in CamelCase.
For words = ["is", "valid", "right"] and variableName = "isValId", the output should be camelCaseSeparation(words, variableName) = false.
variableName is separated to words "is", "val", "id", and not all words are in words.
Input/Output
[execution time limit] 4 seconds (js)
[input] array. string words
An array of words consisting of lowercase English letters.
Guaranteed constraints:
1 ≤ words. length ≤ 103.
[input] string variableName
A string to be checked. Consists of lowercase and uppercase English letters only.
Guaranteed constraints:
1 ≤ variableName. length ≤ 103.
[output] boolean
Return true, if variableName is a complex variable name, and false otherwise.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 19:20
1)consider the following code snippet: #ifndef book_h#define book_hconst double max_cost = 1000.0; class book{public: book(); book(double new_cost); void set_cost(double new_cost); double get_cost() const; private: double cost; }; double calculate_terms(book bk); #endifwhich of the following is correct? a)the header file is correct as given.b)the definition of max_cost should be removed since header files should not contain constants.c)the definition of book should be removed since header files should not contain class definitions.d)the body of the calculate_terms function should be added to the header file.
Answers: 1
question
Computers and Technology, 23.06.2019 04:10
2pointswho was mikhail gorbachev? oa. a russian leader who opposed a coupob. a polish leader who founded the labor union "solidarityoc. a soviet leader who called for a closer relationship with the unitedstates, economic reform, and a more open societyd. a soviet leader who called for more oppression in the soviet union
Answers: 3
question
Computers and Technology, 23.06.2019 04:40
The narrative structure of the popular movies can be broken down into
Answers: 3
question
Computers and Technology, 23.06.2019 14:30
Select the correct answer. sean is a computer programmer. he has programmed an application for toddlers that plays nursery rhymes. however, a logic error has occurred in the program. which problem is a likely consequence of the error? a. the program crashes every time the user wants to play the nursery rhymes. b. the program crosses its buffer boundaries and overwrites an adjacent program. c. the program plays a different nursery rhyme than the one the user intended to play. d. the program shows different structures in its programming language code. e. the program introduces new viruses every time the user plays a nursery rhyme.
Answers: 1
You know the right answer?
JavaScript You are developing a new programming language and currently working on variable names....
Questions
question
Mathematics, 15.04.2020 01:27
Questions on the website: 13722367