MCPcopy Create free account
hub / github.com/Tiwarishashwat/InterviewCodes / shift

Method shift

TargetArrayInGivenOrder.java:4–10  ·  view source on GitHub ↗
(int arr[],int pos,int n)

Source from the content-addressed store, hash-verified

2class Solution {
3
4 public static void shift(int arr[],int pos,int n)
5 {
6 for(int i=n-2;i>=pos;i--)
7 {
8 arr[i+1]=arr[i];
9 }
10 }
11 public int[] createTargetArray(int[] nums, int[] index) {
12 int target[] = new int[nums.length];
13 for(int i=0;i<nums.length;i++)

Callers 1

createTargetArrayMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected