Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1f5f815

Browse files
authored
Merge pull requestneetcode-gh#2639 from Sar-Go/main
Create: 0912-sort-an-array.go ; Create: 1929-concatenation-of-array.go
2 parents5abb666 +0588c2e commit1f5f815

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

‎go/0912-sort-an-array.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
funcsortArray(nums []int) []int {
2+
sort.Ints(nums)
3+
returnnums
4+
}

‎go/1929-concatenation-of-array.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
funcgetConcatenation(nums []int) []int {
2+
n:=len(nums)
3+
ans:=make([]int,2*n)//lets make an array of int type and 2*n size
4+
i:=0
5+
fori<n {//implementing for loop for the given condition
6+
ans[i]=nums[i]
7+
ans[i+n]=nums[i]
8+
i++
9+
}
10+
returnans
11+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp