-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDropNumber.json
More file actions
34 lines (34 loc) · 1012 Bytes
/
DropNumber.json
File metadata and controls
34 lines (34 loc) · 1012 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
{
"font-normal": "JetBrainsMono-Regular.ttf",
"font-bold": "JetBrainsMono-Bold.ttf",
"font-italic": "JetBrainsMono-BoldItalic.ttf",
"font-bold-italic": "JetBrainsMono-Italic.ttf",
"font-size": 19,
"width-margin": 5,
"height-margin": 5,
"spacing": 1,
"background-color": [
255,
255,
255
],
"source-code": [
" public static int[] dropNumber(int[] input, int pos) {",
" if (input.length == 0 || pos >= input.length) {",
" throw new IllegalArgumentException();",
" }",
"",
" int[] result = new int[input.length - 1];",
"",
" for (int i = 0; i < pos; i++) {",
" result[i] = input[i];",
" }",
"",
" for (int i = pos; i + 1 < input.length; i++) {",
" result[i] = input[i + 1];",
" }",
"",
" return result;",
" }"
]
}