add new solutions

This commit is contained in:
kanna5 2026-01-27 18:38:43 +09:00
parent 67cad91898
commit eb6ffe8114
No known key found for this signature in database
24 changed files with 933 additions and 14 deletions

View file

@ -0,0 +1,35 @@
package q1114
type Foo struct {
one, two chan struct{}
}
func NewFoo() *Foo {
return &Foo{
one: make(chan struct{}),
two: make(chan struct{}),
}
}
func (f *Foo) First(printFirst func()) {
// Do not change this line
printFirst()
close(f.one)
}
func (f *Foo) Second(printSecond func()) {
<-f.one
/// Do not change this line
printSecond()
close(f.two)
}
func (f *Foo) Third(printThird func()) {
<-f.two
// Do not change this line
printThird()
}