Skip to content

Commit 77a45e1

Browse files
committed
Repo Created
1 parent 9c2e819 commit 77a45e1

12 files changed

+1612
-0
lines changed

eighth.go

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
package main
2+
3+
import (
4+
"strings"
5+
"fmt"
6+
)
7+
8+
func main() {
9+
fmt.Println(len(strings.Split(inpu, "\n")))
10+
}
11+
12+
var inpu = `1512315907 , h
13+
1512390482 , i
14+
1512445011 , n
15+
1512259825 , t
16+
1512462724 , o
17+
1512092427 , W
18+
1512382452 , e
19+
1512334517 , c
20+
1512162866 , o
21+
1512524186 , s
22+
1512157549 , d
23+
1512533336 ,
24+
1512220061 , s
25+
1512188494 , t
26+
1512487644 , f
27+
1512361631 , e
28+
1512544518 , r
29+
1512516199 , i
30+
1512100792 , e
31+
1512226078 , e
32+
1512155690 ,
33+
1512202621 , h
34+
1512308584 , t
35+
1512550113 , n
36+
1512109804 , l
37+
1512358457 , l
38+
1512512636 , h
39+
1512214759 , n
40+
1512413483 , l
41+
1512393893 , s
42+
1512326020 , i
43+
1512445277 , g
44+
1512487970 ,
45+
1512357682 , a
46+
1512245155 , r
47+
1512374463 , g
48+
1512186848 ,
49+
1512347726 , h
50+
1512417162 , e
51+
1512213210 ,
52+
1512209016 , e
53+
1512132390 , l
54+
1512451550 , h
55+
1512413421 ,
56+
1512505833 , t
57+
1512164659 , n
58+
1512446004 , t
59+
1512333280 ,
60+
1512551108 , g
61+
1512359858 , l
62+
1512258259 ,
63+
1512534928 , s
64+
1512213867 , a
65+
1512549209 , i
66+
1512223300 , w
67+
1512331738 , s
68+
1512364155 , n
69+
1512453898 ,
70+
1512385398 ,
71+
1512266467 , o
72+
1512269057 ,
73+
1512538827 , t
74+
1512183081 , e`

fibo.go

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package main
2+
3+
import "fmt"
4+
5+
// fibonacci is a function that returns
6+
// a function that returns an int.
7+
func fibonacci() func() int {
8+
c := 0
9+
a := 0
10+
b := 1
11+
return func() int {
12+
c = a
13+
a = a+b
14+
b = c
15+
return b
16+
}
17+
}
18+
19+
func main() {
20+
f := fibonacci()
21+
for i := 0; i < 10; i++ {
22+
fmt.Println(f())
23+
}
24+
}

fifth.go

+225
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,225 @@
1+
package main
2+
3+
import (
4+
"strings"
5+
"strconv"
6+
"fmt"
7+
)
8+
9+
func main() {
10+
posts := strings.Split(in, "\n")
11+
lastLikes := 4455
12+
bestPostsCount := 0
13+
for _, post := range posts {
14+
likes, err := strconv.Atoi(post)
15+
if err==nil {
16+
if likes > lastLikes {
17+
bestPostsCount++
18+
}
19+
lastLikes = likes
20+
}
21+
}
22+
fmt.Println(bestPostsCount)
23+
}
24+
25+
var in = `131
26+
58
27+
182
28+
97
29+
71
30+
100
31+
131
32+
131
33+
9
34+
75
35+
195
36+
137
37+
85
38+
37
39+
101
40+
111
41+
54
42+
106
43+
66
44+
42
45+
95
46+
49
47+
79
48+
84
49+
76
50+
139
51+
163
52+
49
53+
95
54+
159
55+
152
56+
187
57+
173
58+
84
59+
45
60+
129
61+
72
62+
167
63+
108
64+
123
65+
142
66+
114
67+
123
68+
28
69+
95
70+
61
71+
44
72+
110
73+
90
74+
48
75+
70
76+
183
77+
154
78+
68
79+
72
80+
12
81+
154
82+
163
83+
46
84+
5
85+
162
86+
112
87+
61
88+
12
89+
51
90+
112
91+
161
92+
136
93+
98
94+
131
95+
163
96+
29
97+
196
98+
146
99+
63
100+
80
101+
107
102+
67
103+
109
104+
79
105+
39
106+
141
107+
136
108+
159
109+
160
110+
171
111+
14
112+
46
113+
55
114+
140
115+
89
116+
26
117+
3
118+
130
119+
177
120+
100
121+
1
122+
182
123+
117
124+
199
125+
107
126+
3
127+
161
128+
3
129+
21
130+
9
131+
197
132+
85
133+
18
134+
121
135+
15
136+
189
137+
100
138+
128
139+
24
140+
6
141+
68
142+
33
143+
87
144+
2
145+
147
146+
54
147+
100
148+
146
149+
68
150+
119
151+
88
152+
76
153+
56
154+
92
155+
186
156+
73
157+
13
158+
75
159+
176
160+
105
161+
58
162+
71
163+
6
164+
116
165+
30
166+
88
167+
119
168+
23
169+
101
170+
31
171+
106
172+
23
173+
6
174+
24
175+
192
176+
43
177+
40
178+
25
179+
3
180+
94
181+
155
182+
77
183+
74
184+
146
185+
135
186+
161
187+
182
188+
105
189+
37
190+
80
191+
171
192+
191
193+
27
194+
117
195+
34
196+
66
197+
54
198+
30
199+
154
200+
107
201+
128
202+
36
203+
192
204+
35
205+
161
206+
4
207+
12
208+
63
209+
190
210+
117
211+
75
212+
91
213+
59
214+
88
215+
171
216+
133
217+
188
218+
182
219+
124
220+
169
221+
200
222+
173
223+
196
224+
25
225+
179`

first.go

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package main
2+
3+
import (
4+
"fmt"
5+
"math"
6+
)
7+
8+
func main(){
9+
//var result uint64 = 1
10+
//for i:=0;i<42;i++ {
11+
// result *= 2
12+
//}
13+
//fmt.Println(result)
14+
// OR
15+
var another uint64 = 1<<42
16+
fmt.Println(another)
17+
fmt.Println(math.Pow(2, 42))
18+
}

0 commit comments

Comments
 (0)