+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Methods
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Design a solution to calculate what to pay for a set of phone calls. The function must receive an
+array of objects that will contain the identifier, type and duration attributes. For the type attribute,
+the only valid values are: National, International and Local
+
+The criteria for calculating the cost of each call is as follows:
+
+International: first 3 minutes $ 7.56 -> $ 3.03 for each additional minute
+National: first 3 minutes $ 1.20 -> $ 0.48 per additional minute
+Local: $ 0.2 per minute.
+
+The function must return the total calls, the details of each call (the detail received + the cost of the call)
+and the total to pay taking into account all calls
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+
+
+
+
+ Name |
+
+
+ Type |
+
+
+
+
+
+ Description |
+
+
+
+
+
+
+
+
+ calls |
+
+
+
+
+
+Array.<Call>
+
+
+
+ |
+
+
+
+
+
+ Call's information to be processed |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Returns:
+
+
+
+ - Processed information
+
+
+
+
+
+ -
+ Type
+
+ -
+
+CallsResponse
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ fibonacci(limit) → {Array.<number>}
+
+
+
+
+
+
+
+ Given a number, write a function that returns the "n" numbers of the fibonacci sequence
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+
+
+
+
+ Name |
+
+
+ Type |
+
+
+
+
+
+ Description |
+
+
+
+
+
+
+
+
+ limit |
+
+
+
+
+
+number
+
+
+
+ |
+
+
+
+
+
+ Number of fibonacci numbers to be generated |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Returns:
+
+
+
+ - Fibonacci Serie
+
+
+
+
+
+ -
+ Type
+
+ -
+
+Array.<number>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ morseCode(message, convertTo) → {string}
+
+
+
+
+
+
+
+ Write a program that automatically converts english text to morse code and vice versa,
+consider only use upper case letters when converting
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+
+
+
+
+ Name |
+
+
+ Type |
+
+
+
+
+
+ Description |
+
+
+
+
+
+
+
+
+ message |
+
+
+
+
+
+string
+
+
+
+ |
+
+
+
+
+
+ String to be converted |
+
+
+
+
+
+
+ convertTo |
+
+
+
+
+
+string
+
+
+
+ |
+
+
+
+
+
+ (morse | english) |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Returns:
+
+
+
+ - String converted to english or morse code
+
+
+
+
+
+ -
+ Type
+
+ -
+
+string
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The height in cm of several people was taken, in addition, the age of each person and
+extra information are also known. An algorithm is required to calculate average age and
+average height. In addition, we need to know the information of the tallest person, and
+the information of the youngest person.
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+
+
+
+
+ Name |
+
+
+ Type |
+
+
+
+
+
+ Description |
+
+
+
+
+
+
+
+
+ people |
+
+
+
+
+
+Array.<Person>
+
+
+
+ |
+
+
+
+
+
+ People information to be processed |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Returns:
+
+
+
+ - Processed information
+
+
+
+
+
+ -
+ Type
+
+ -
+
+PeopleResponse
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ template(model, character, message) → {string}
+
+
+
+
+
+
+
+ Create a method that takes 3 input parameters. A template, a character, and a character string.
+Example: (XXX)XXX-XXX-XX, "X", 26365858364.
+
+All the characters in the template that match the character (second parameter) that is passed to
+the function must be replaced with the third parameter.
+Examples:
+(XXX)XXX-XXX-XX, "X", 26365858364 -> (263)658-583-64
+(XXX)XXX-XXX-XX, "X", 26365858 -> (263)658-58X-XX
+(XXX)XXX-XXX-XX, "X", 2636585836456 -> (263)658-583-64
+
+Consider validating that the template includes the character and the third parameter is not empty.
+In the case that one of these conditions is not met, the method must return the message "Invalid parameters"
+
+
+
+
+
+
+
+
+
+
+ Parameters:
+
+
+
+
+
+
+ Name |
+
+
+ Type |
+
+
+
+
+
+ Description |
+
+
+
+
+
+
+
+
+ model |
+
+
+
+
+
+string
+
+
+
+ |
+
+
+
+
+
+ Template to be used |
+
+
+
+
+
+
+ character |
+
+
+
+
+
+string
+
+
+
+ |
+
+
+
+
+
+ Character to search on template in order to replace it |
+
+
+
+
+
+
+ message |
+
+
+
+
+
+string
+
+
+
+ |
+
+
+
+
+
+ String to be placed on the template |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Returns:
+
+
+
+ - Formatted string covering the template
+
+
+
+
+
+ -
+ Type
+
+ -
+
+string
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Type Definitions
+
+
+
+Call
+
+
+
+
+
+
+ Type:
+
+
+
+
+
+
+ Properties:
+
+
+
+
+
+
+
+ Name |
+
+
+ Type |
+
+
+
+
+
+ Description |
+
+
+
+
+
+
+
+
+ identifier |
+
+
+
+
+
+string
+
+
+
+ |
+
+
+
+
+
+ Call's identifier |
+
+
+
+
+
+
+ type |
+
+
+
+
+
+string
+
+
+
+ |
+
+
+
+
+
+ Call's type |
+
+
+
+
+
+
+ duration |
+
+
+
+
+
+number
+
+
+
+ |
+
+
+
+
+
+ Call's duration |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+CallsResponse
+
+
+
+
+
+
+ Type:
+
+
+
+
+
+
+ Properties:
+
+
+
+
+
+
+
+ Name |
+
+
+ Type |
+
+
+
+
+
+ Description |
+
+
+
+
+
+
+
+
+ totalCalls |
+
+
+
+
+
+number
+
+
+
+ |
+
+
+
+
+
+ Number of processed calls |
+
+
+
+
+
+
+ total |
+
+
+
+
+
+number
+
+
+
+ |
+
+
+
+
+
+ Total to pay including all the processed calls |
+
+
+
+
+
+
+ callsDetails |
+
+
+
+
+
+Array.<ProcessedCall>
+
+
+
+ |
+
+
+
+
+
+ Processed information about calls |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+PeopleResponse
+
+
+
+
+
+
+ Type:
+
+
+
+
+
+
+ Properties:
+
+
+
+
+
+
+
+ Name |
+
+
+ Type |
+
+
+
+
+
+ Description |
+
+
+
+
+
+
+
+
+ ageProm |
+
+
+
+
+
+number
+
+
+
+ |
+
+
+
+
+
+ People average age |
+
+
+
+
+
+
+ heightProm |
+
+
+
+
+
+number
+
+
+
+ |
+
+
+
+
+
+ People average height |
+
+
+
+
+
+
+ youngerPerson |
+
+
+
+
+
+Person
+
+
+
+ |
+
+
+
+
+
+ Younger person information |
+
+
+
+
+
+
+ tallerPerson |
+
+
+
+
+
+Person
+
+
+
+ |
+
+
+
+
+
+ Taller person information |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Person
+
+
+
+
+
+
+ Type:
+
+
+
+
+
+
+ Properties:
+
+
+
+
+
+
+
+ Name |
+
+
+ Type |
+
+
+
+
+
+ Description |
+
+
+
+
+
+
+
+
+ name |
+
+
+
+
+
+string
+
+
+
+ |
+
+
+
+
+
+ Person's name |
+
+
+
+
+
+
+ lastname |
+
+
+
+
+
+string
+
+
+
+ |
+
+
+
+
+
+ Person's lastname |
+
+
+
+
+
+
+ age |
+
+
+
+
+
+number
+
+
+
+ |
+
+
+
+
+
+ Person's age |
+
+
+
+
+
+
+ weight |
+
+
+
+
+
+number
+
+
+
+ |
+
+
+
+
+
+ Person's weight |
+
+
+
+
+
+
+ height |
+
+
+
+
+
+number
+
+
+
+ |
+
+
+
+
+
+ Person's height |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ProcessedCall
+
+
+
+
+
+
+ Type:
+
+
+
+
+
+
+ Properties:
+
+
+
+
+
+
+
+ Name |
+
+
+ Type |
+
+
+
+
+
+ Description |
+
+
+
+
+
+
+
+
+ identifier |
+
+
+
+
+
+string
+
+
+
+ |
+
+
+
+
+
+ Call's identifier |
+
+
+
+
+
+
+ type |
+
+
+
+
+
+string
+
+
+
+ |
+
+
+
+
+
+ Call's type |
+
+
+
+
+
+
+ duration |
+
+
+
+
+
+number
+
+
+
+ |
+
+
+
+
+
+ Call's duration |
+
+
+
+
+
+
+ callCost |
+
+
+
+
+
+number
+
+
+
+ |
+
+
+
+
+
+ Call's cost |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ - Source:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+