Skip to content

Commit

Permalink
Merge pull request neetcode-gh#894 from Vitali-Matteo/patch-5
Browse files Browse the repository at this point in the history
Create 1929-Cocatenation-Of-Array.cpp
  • Loading branch information
Ahmad-A0 authored Aug 23, 2022
2 parents 57b2992 + 43d1756 commit b044306
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions cpp/1929-Cocatenation-Of-Array.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
class Solution{
public:
vector<int> getConcatenation(vector<int>& nums){
vector<int> ans;
int len;
len = nums.size();
for(int i = 0; i < 2 * len; i++){
ans.push_back(nums[i % len]);
}
return ans;
}
};

0 comments on commit b044306

Please sign in to comment.