subject
Computers and Technology, 04.01.2021 20:00 rome58

A challenge in an amazon hackathon programming competition requires the construction of a sequence using a specified number of integers within a range. The sequence must be strictly increasing at first and then strictly decreasing. The goal is to maximize the sequence array elements starting from the beginning. For example, [4, 5, 4, 3, 2] beats [3,4,5,4,3] because its first element is larger, and [4, 5, 6, 5, 4] beats [4,5,4,3,2] because its third element is larger. Given the length of the sequence and the range of integers, return the winning sequence. If it is not possible to construct such a sequence, return -1. Write an algorithm that returns a winning sequence and -1 if the sequence is not possible.
Input
The input to the function/method consists of three arguments: num, an integer representing the size of sequence to create; lowerEnd, an integer representing the lower end of integer range; upperEnd, an integer representing the upper end of integer range.
Output
Return a list of integers representing the winning sequence and if the sequence is not possible then return a list with an integer -1.
Constraints
3 <= num <= 1045
1 <= lowerEnds <= upperEnds <= 1045
Example
Input:
num = 5
lowerEnd = 3
upperEnd = 10
Output:
[9,10,9,8,7]
Explanation:
In this case, [9, 10, 9, 8, 7] is the winning sequence. It maintains the constraints of being first strictly increasing and then strictly decreasing, and there is no way to have integers in the sequence that are greater than [9, 10, 9, 8, 7]. So the output is [9, 10, 9, 8, 7].

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 22:00
When determining the classification of data, which one of the following is the most important consideration? a. processing systemb. valuec. storage mediad. accessibility
Answers: 2
question
Computers and Technology, 23.06.2019 16:00
Kenny works with an it company. his company is about to launch new software in the market. he has to ensure that this new software is functional and meets all of the quality standards set up at the planning stage. which job profile is kenny likely to have? kenny is likely to have the job profile of a blank .
Answers: 2
question
Computers and Technology, 24.06.2019 08:20
Evaluate the scenario below and indicate how to handle the matter appropriately. situation: michael received an e-mail from what he thought was his doctor’s office, requesting his social security number. since he had just been in to see his doctor last week, he replied to the e-mail with his social security number.
Answers: 2
question
Computers and Technology, 24.06.2019 09:50
Suppose you are an ad-serving company and you maintain a log of cookie data for ads you serve to the web pages for a particular vendor (say amazon). a. how can you use this data to determine which are the best ads? b. how can you use this data to determine which are the best ad formats? c. how could you records of past ads and ad clicks to determine which ads to send to a given ip address? d. how could you use this data to determine how well the technique you used in your answer to part c was working? e. how could you use this data to determine that a given ip address is used by more than one person? f. how does having this data give you a competitive advantage vis-à-vis other ad-serving companies?
Answers: 2
You know the right answer?
A challenge in an amazon hackathon programming competition requires the construction of a sequence u...
Questions
question
Mathematics, 22.01.2021 20:50
question
History, 22.01.2021 20:50
question
Mathematics, 22.01.2021 20:50
question
Mathematics, 22.01.2021 20:50
question
Mathematics, 22.01.2021 20:50
question
Mathematics, 22.01.2021 20:50
Questions on the website: 13722360