Copy array manually
Java
Easy
4 views
Problem Description
Task: create and return a new array copy without using Arrays.copyOf.
Output Format
Return value
Constraints
Return empty array for empty input.
Official Solution
static int[] copy(int[] a){int[] b=new int[a.length];for(int i=0;i<a.length;i++) b[i]=a[i];return b;}
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!