Question: Write an R-script to initialize a vector with integers, then reverse the last 'k' elements of this vector leaving the other elements in the
Write an R-script to initialize a vector with integers, then reverse the last 'k' elements of this vector leaving the other elements in the same relative order without using any pre-defined function, also remove the duplicate elements from this reverse part (keep the 1st occurrence). Now display this updated vector. Example: INPUT: 8 10 15 12 30 25 40 25 50 37 if k=5, then OUTPUT: 8 10 15 12 37 50 25 40 30
Step by Step Solution
3.32 Rating (149 Votes )
There are 3 Steps involved in it
The answer provided ... View full answer
Get step-by-step solutions from verified subject matter experts
