Skip to content

Commit

Permalink
Merge pull request #2639 from Sar-Go/main
Browse files Browse the repository at this point in the history
Create: 0912-sort-an-array.go ; Create: 1929-concatenation-of-array.go
  • Loading branch information
tahsintunan committed Jul 3, 2023
2 parents 5abb666 + 0588c2e commit 1f5f815
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
4 changes: 4 additions & 0 deletions go/0912-sort-an-array.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
func sortArray(nums []int) []int {
sort.Ints(nums)
return nums
}
11 changes: 11 additions & 0 deletions go/1929-concatenation-of-array.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
func getConcatenation(nums []int) []int {
n := len(nums)
ans := make([]int, 2*n) //lets make an array of int type and 2*n size
i := 0
for i < n { //implementing for loop for the given condition
ans[i] = nums[i]
ans[i+n] = nums[i]
i++
}
return ans
}

0 comments on commit 1f5f815

Please sign in to comment.