Skip to content

Latest commit

 

History

History
32 lines (17 loc) · 747 Bytes

1929 Concatenation of Array f13fffc58e204ae6be988bd776e3f601.md

File metadata and controls

32 lines (17 loc) · 747 Bytes

1929. Concatenation of Array

Concatenation of Array - LeetCode

package com.mycompany.problemsolving;

import java.util.Arrays;

public class ProblemSolving {
    
     public static int[] getConcatenation(int[] nums) {
         
         int output[] = new int[nums.length + nums.length];
         
         System.arraycopy(nums, 0, output, 0, nums.length);
         System.arraycopy(nums, 0, output, nums.length, nums.length);
         
        
         return output;
    }

    public static void main(String[] args) {
        
        System.out.println(Arrays.toString(getConcatenation(new int [] {1,3,2,1}) ));
        
        
        
        
    }
}