Question: JAVASCRIPT Your task is to write a program that models growth trends based on historical financial data. Specifically, you will be given an array of
JAVASCRIPT
Your task is to write a program that models growth trends based on historical financial data. Specifically, you will be given an array of financial growth percentages which may include negative values representing a decrease You need to return an array of the growth trends squared, sorted in nondecreasing order, simulating a realworld business data analysis scenario.
Problem Statement:
Given an array growthPercentages representing yearly growth percentages of a company's revenue, sorted in nondecreasing order, return an array of the squared growth percentages, also sorted in nondecreasing order.
Input Format:
An array growthPercentages where each element is an integer representing the yearly growth percentage.
Output Format:
An array of integers representing the squared growth percentages, sorted in nondecreasing order.
Examples:
Example :
Input: growthPercentages
Output:
Explanation: After squaring, the array becomes After sorting, it becomes
Example :
Input: growthPercentages
Output:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
