diff --git a/leetcode/l1929_concatenationofarray.cpp b/leetcode/l1929_concatenationofarray.cpp new file mode 100644 index 0000000..601ca93 --- /dev/null +++ b/leetcode/l1929_concatenationofarray.cpp @@ -0,0 +1,37 @@ +// basic approach: use two loops to generate the first half and the second half +/* +class Solution { +public: + vector getConcatenation(vector& nums) { + // use the default constructor + vector ans; + int size = nums.size(); + for(int i=0;i getConcatenation(vector& nums) { + // use the copy constructor + vector ans(nums); + int size = nums.size(); + // copy the second half + for(int i=0;i