Repository navigation
Expand file tree
/
Copy pathhelp.txt
More file actions
90 lines (81 loc) · 1.51 KB
/
Copy pathhelp.txt
File metadata and controls
90 lines (81 loc) · 1.51 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/...................................../
#Randoom Number Array :=
example input-->
12
13 8 14 7 7 13 16 12 11 9 10 13
useage -->
* you will the value inside ans as an Array
[
13, 8, 14, 7, 7,
13, 16, 12, 11, 9,
10, 13
]
/...................................../
#Randoom chars Array :=
example input-->
14
= ; ; ; : ? ; ? < = = ; < ;
useage -->
input.split(" ") //
* op -> [
'?', ':', ';', '=',
'=', ':', '<', ';',
'=', ':', ':', '>',
'=', '='
]
/...................................../
#Multicase Number Array :=
example input-->
4
15
14 8 10 12 13 8 8 11 10 7 9 13 7 7 14
12
10 7 8 8 8 12 13 9 11 14 9 15
15
13 9 10 12 7 13 14 8 8 9 7 9 10 9 14
15
10 14 8 15 8 8 13 8 8 12 11 9 13 11 12
useage -->
let newInput = input.split("\n");
for (let i = 1; i < newInput.length; i += 2) {
let n = +newInput[i];
let arr = newInput[i + 1].split(" ").map(Number);
console.log(n, arr);
}
/...................................../
#Randoom Alphabet Array:=
example input-->
11
b m n r l m u e x w i
useage -->
input.split(" ")
op->
[
'h', 'g', 'h', 'x',
'c', 's', 'i', 'j',
'o', 'x', 's'
]
/...................................../
TwodArray Number (Randoom)
example input-->
5 4
0 3 7 0
1 3 7 1
8 2 3 2
7 3 6 0
0 1 2 2
useage -->
let newInput = input.split("\n");
let hook = newInput[0].split(" ").map(Number);
let [N, M] = [hook[0], hook[1]];
let arr = [];
for (let i = 1; i < N; i++) {
arr.push(newInput[i].split(" "));
}
op-->
[
[ '0', '3', '7', '0' ],
[ '1', '3', '7', '1' ],
[ '8', '2', '3', '2' ],
[ '7', '3', '6', '0' ]
]