IN JAVA Write the method all End() * * Your method will take an array of int
Fantastic news! We've Found the answer you've been seeking!
Question:
IN JAVA
Write the method all End()
*
* Your method will take an array of int of ODD length.
* You should replace the first and middle elements with
* the last, so that [1, 2, 3] becomes [3, 3, 3].
* Return the modified parameter.
* The array will have a length of at least 1
* and the length will be ODD.
*
* Some examples:
* all End([1, 2, 3]) -> [3, 3, 3]
* all End([1, 2, 3, 4, 5]) -> [5, 2, 5, 4, 5]
* all End([7]) -> [7]
*
* @param nums an array of int (length will be at least 1)
* @return the modified array
Related Book For
An Introduction to the Mathematics of Financial Derivatives
ISBN: 978-0123846822
3rd edition
Authors: Ali Hirsa, Salih N. Neftci
Posted Date: