PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: JuliaLinearAlgebra/GenericLinearAlgebra.jl (julia)

Issue:
BoundsError bug in SVD for zero matrix
I see the following behavior in v0.3.8 (not sure when it started, but this error did not occur before about Dec 5, 2022, the last time I ran Hypatia.jl's test suite):
```
julia> svd(zeros(BigFloat, 2, 2))
ERROR: BoundsError: attempt to access 1-element Vector{BigFloat} at index [0]
Stacktrace:
 [1] setindex!
   @ ./array.jl:966 [inlined]
 [2] svdDemmelKahan!(B::Bidiagonal{BigFloat, Vector{BigFloat}}, n1::Int64, n2::Int64, U::Matrix{BigFloat}, Vᴴ::Matrix{BigFloat})
   @ GenericLinearAlgebra ~/.julia/packages/GenericLinearAlgebra/ilNvI/src/svd.jl:110
 [3] __svd!(B::Bidiagonal{BigFloat, Vector{BigFloat}}, U::Matrix{BigFloat}, Vᴴ::Matrix{BigFloat}; tol::BigFloat, debug::Bool)
   @ GenericLinearAlgebra ~/.julia/packages/GenericLinearAlgebra/ilNvI/src/svd.jl:184
 [4] _svd!(B::Bidiagonal{BigFloat, Vector{BigFloat}}; tol::BigFloat, debug::Bool)
   @ GenericLinearAlgebra ~/.julia/packages/GenericLinearAlgebra/ilNvI/src/svd.jl:301
 [5] svd!(A::Matrix{BigFloat}; tol::BigFloat, full::Bool, alg::LinearAlgebra.DivideAndConquer, debug::Bool)
   @ GenericLinearAlgebra ~/.julia/packages/GenericLinearAlgebra/ilNvI/src/svd.jl:658
 [6] #svd#114
   @ ~/julia/usr/share/julia/stdlib/v1.8/LinearAlgebra/src/svd.jl:179 [inlined]
 [7] svd(A::Matrix{BigFloat})
   @ LinearAlgebra ~/julia/usr/share/julia/stdlib/v1.8/LinearAlgebra/src/svd.jl:178
 [8] top-level scope
   @ REPL[15]:1
```

Pull request:
zero singular values

Closes #119

Patch:
diff --git a/src/svd.jl b/src/svd.jl
index dd21116..1d53d65 100644
--- a/src/svd.jl
+++ b/src/svd.jl
@@ -253,12 +253,16 @@ function _svdvals!(B::Bidiagonal{T}; tol = eps(T)) where {T<:Real}
     return sort(abs.(diag(B)), rev = true)
 end
 
+# We want to avoid that zero eigenvalues zero out any singular vectors so we'd
+# have to use a modified sign function
+_sign(x) = ifelse(iszero(x), one(x), sign(x))
+
 function _sort_and_adjust!(U, s, Vᴴ)
     n = length(s)
 
     # Adjust sign of singular values if necessary
     if any(!isposdef, s)
-        rmul!(U, Diagonal(sign.(s)))
+        rmul!(U, Diagonal(_sign.(s)))
         map!(abs, s, s)
     end
 


Test patch:
diff --git a/test/svd.jl b/test/svd.jl
index eb60047..8fddc86 100644
--- a/test/svd.jl
+++ b/test/svd.jl
@@ -241,4 +241,11 @@ using Test, GenericLinearAlgebra, LinearAlgebra, Quaternions, DoubleFloats
         BF = GenericLinearAlgebra.bidiagonalize!(copy(A))
         @test (BF.rightQ' * Matrix(I, size(A)...)) * BF.rightQ ≈ I
     end
+
+    @testset "Issue 119" begin
+        F = svd(zeros(BigFloat, 2, 2))
+        @test F.S == zeros(2)
+        @test F.U == I
+        @test F.Vt == I
+    end
 end
Repository: vaskoz/dailycodingproblem-go (go)

Issue:
Day 21
Good morning! Here's your coding interview problem for today.

This problem was asked by Snapchat.

Given an array of time intervals (start, end) for classroom lectures (possibly overlapping), find the minimum number of rooms required.

For example, given [(30, 75), (0, 50), (60, 150)], you should return 2.

Pull request:
Day 21 - overlapping classes
Resolves #51 

Patch:
diff --git a/README.md b/README.md
index 8697aff..9d58811 100644
--- a/README.md
+++ b/README.md
@@ -34,3 +34,4 @@ problems from
 * [Day 19 Flight Itinerary](https://github.com/vaskoz/dailycodingproblem-go/issues/45)
 * [Day 19 Sudoku Solver](https://github.com/vaskoz/dailycodingproblem-go/issues/47)
 * [Day 20](https://github.com/vaskoz/dailycodingproblem-go/issues/49)
+* [Day 21](https://github.com/vaskoz/dailycodingproblem-go/issues/51)
diff --git a/day21/problem.go b/day21/problem.go
new file mode 100644
index 0000000..cb9d6d6
--- /dev/null
+++ b/day21/problem.go
@@ -0,0 +1,40 @@
+package day21
+
+import "sort"
+
+// Lecture represents a class that needs a room with a start time and end time.
+type Lecture struct {
+	start, end int
+}
+
+// lectureEvent exists for sorting purposes.
+type lectureEvent struct {
+	time     int
+	starting bool
+}
+
+// MinimumRooms calculates the minimum number of rooms to accomodate
+// overlapping schedules.
+// Runtime is O(N log N) with O(2N) space
+func MinimumRooms(lectures []Lecture) int {
+	events := make([]lectureEvent, 0, 2*len(lectures))
+	for i := range lectures {
+		events = append(events, lectureEvent{lectures[i].start, true})
+		events = append(events, lectureEvent{lectures[i].end, false})
+	}
+	sort.Slice(events, func(i, j int) bool {
+		return events[i].time < events[j].time
+	})
+	var max, active int
+	for i := range events {
+		if events[i].starting {
+			active++
+		} else {
+			active--
+		}
+		if max < active {
+			max = active
+		}
+	}
+	return max
+}


Test patch:
diff --git a/day14/problem_test.go b/day14/problem_test.go
index 27dcc46..0070cf4 100644
--- a/day14/problem_test.go
+++ b/day14/problem_test.go
@@ -11,8 +11,8 @@ var testcases = []struct {
 	delta      float64
 }{
 	{100000, 3.1415, 0.1},
-	{10000, 3.1415, 0.1},
-	{1000, 3.1415, 0.1},
+	{10000, 3.1415, 0.2},
+	{1000, 3.1415, 0.5},
 }
 
 func TestEstimatePi(t *testing.T) {
diff --git a/day21/problem_test.go b/day21/problem_test.go
new file mode 100644
index 0000000..fff5c93
--- /dev/null
+++ b/day21/problem_test.go
@@ -0,0 +1,28 @@
+package day21
+
+import "testing"
+
+var testcases = []struct {
+	lectures    []Lecture
+	roomsNeeded int
+}{
+	{[]Lecture{{30, 75}, {0, 50}, {60, 150}}, 2},
+	{[]Lecture{{0, 10}, {10, 20}, {20, 30}, {1, 11}, {11, 21}, {21, 31}}, 2},
+}
+
+func TestMinimumRooms(t *testing.T) {
+	t.Parallel()
+	for _, tc := range testcases {
+		if result := MinimumRooms(tc.lectures); result != tc.roomsNeeded {
+			t.Errorf("Expected %v but got %v", tc.roomsNeeded, result)
+		}
+	}
+}
+
+func BenchmarkMinimumRooms(b *testing.B) {
+	for i := 0; i < b.N; i++ {
+		for _, tc := range testcases {
+			MinimumRooms(tc.lectures)
+		}
+	}
+}
Repository: vuejs/composition-api (ts)

Issue:
infinite loop when using proxyRefs with computed property
This short code gives "Uncaught RangeError: Maximum call stack size exceeded".

```js
let object = proxyRefs({
  a: computed(() => 1),
});
console.log(object.a);
```

https://codepen.io/SeregPie/pen/mdOaaBZ

Pull request:
fix(proxyRefs): infinite loop when using proxyRefs.
fix #661 

Patch:
diff --git a/src/reactivity/ref.ts b/src/reactivity/ref.ts
index ce8458a..32c187d 100644
--- a/src/reactivity/ref.ts
+++ b/src/reactivity/ref.ts
@@ -198,16 +198,16 @@ export function proxyRefs<T extends object>(
   for (const key of Object.keys(objectWithRefs)) {
     proxy(value, key, {
       get() {
-        if (isRef(value[key])) {
-          return value[key].value
+        if (isRef(value[RefKey][key])) {
+          return value[RefKey][key].value
         }
-        return value[key]
+        return value[RefKey][key]
       },
       set(v: unknown) {
-        if (isRef(value[key])) {
-          return (value[key].value = unref(v))
+        if (isRef(value[RefKey][key])) {
+          return (value[RefKey][key].value = unref(v))
         }
-        value[key] = unref(v)
+        value[RefKey][key] = unref(v)
       },
     })
   }


Test patch:
diff --git a/test/v3/reactivity/ref.spec.ts b/test/v3/reactivity/ref.spec.ts
index 6806224..26f8078 100644
--- a/test/v3/reactivity/ref.spec.ts
+++ b/test/v3/reactivity/ref.spec.ts
@@ -12,6 +12,7 @@ import {
   unref,
   isReactive,
   shallowRef,
+  proxyRefs,
 } from '../../../src'
 
 describe('reactivity/ref', () => {
@@ -342,4 +343,29 @@ describe('reactivity/ref', () => {
     _trigger!()
     expect(dummy).toBe(2)
   })
+
+  test('proxyRefs', () => {
+    const a = {
+      x: ref(1),
+      obj: {
+        y: ref('foo'),
+      },
+    }
+    const p = proxyRefs(a)
+    expect(p.x).toBe(1)
+    expect(p.obj.y).toBe('foo')
+
+    // @ts-expect-error
+    p.obj.y = 'bar'
+    p.x = 2
+    expect(a.x).toBe(2)
+    expect(a.obj.y).toBe('bar')
+
+    const r = reactive({ k: 'v' })
+    const s = proxyRefs(r)
+    expect(s.k).toBe('v')
+
+    r.k = 'k'
+    expect(s.k).toBe('k')
+  })
 })
Repository: maragudk/gomponents (go)

Issue:
Add "step" attribute
Used in e.g. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/time#using_the_step_attribute

Pull request:
Add Step attribute
See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#step

Fixes #120.

Patch:
diff --git a/html/attributes.go b/html/attributes.go
index 5e56683..3c69f94 100644
--- a/html/attributes.go
+++ b/html/attributes.go
@@ -198,6 +198,10 @@ func SrcSet(v string) g.Node {
 	return g.Attr("srcset", v)
 }
 
+func Step(v string) g.Node {
+	return g.Attr("step", v)
+}
+
 func StyleAttr(v string) g.Node {
 	return g.Attr("style", v)
 }


Test patch:
diff --git a/html/attributes_test.go b/html/attributes_test.go
index 4071101..5e2c179 100644
--- a/html/attributes_test.go
+++ b/html/attributes_test.go
@@ -70,6 +70,7 @@ func TestSimpleAttributes(t *testing.T) {
 		"rowspan":      RowSpan,
 		"src":          Src,
 		"srcset":       SrcSet,
+		"step":         Step,
 		"style":        StyleAttr,
 		"tabindex":     TabIndex,
 		"target":       Target,
Repository: vaskoz/dailycodingproblem-go (go)

Issue:
Day 304
Good morning! Here's your coding interview problem for today.

This problem was asked by Two Sigma.

A knight is placed on a given square on an 8 x 8 chessboard. It is then moved randomly several times, where each move is a standard knight move. If the knight jumps off the board at any point, however, it is not allowed to jump back on.

After `k` moves, what is the probability that the knight remains on the board?

Pull request:
Day304
Resolves #618.

Patch:
diff --git a/README.md b/README.md
index 9735534..89aec29 100644
--- a/README.md
+++ b/README.md
@@ -310,3 +310,4 @@ problems from
 * [Day 300](https://github.com/vaskoz/dailycodingproblem-go/issues/612)
 * [Day 302](https://github.com/vaskoz/dailycodingproblem-go/issues/615)
 * [Day 303](https://github.com/vaskoz/dailycodingproblem-go/issues/616)
+* [Day 304](https://github.com/vaskoz/dailycodingproblem-go/issues/618)
diff --git a/day304/problem.go b/day304/problem.go
new file mode 100644
index 0000000..b970ead
--- /dev/null
+++ b/day304/problem.go
@@ -0,0 +1,36 @@
+package day304
+
+// ProbKnightOnBoard returns the probability that the knight is
+// on the board after k-random moves from a given start position.
+// Assumes an 8x8 chessboard.
+// Uses O(N*N*k) extra space and O(N*N*k) in run time.
+func ProbKnightOnBoard(row, col, k int) float64 {
+	const N = 8
+	moves := []struct{ x, y int }{
+		{1, 2}, {2, 1}, {2, -1}, {1, -2}, {-1, -2}, {-2, -1}, {-2, 1}, {-1, 2},
+	}
+	probs := make([][][]float64, N)
+	for i := range probs {
+		probs[i] = make([][]float64, N)
+		for j := range probs[i] {
+			probs[i][j] = make([]float64, k+1)
+			probs[i][j][0] = 1.0
+		}
+	}
+	for step := 1; step < k+1; step++ {
+		for r := range probs {
+			for c := range probs[r] {
+				p := 0.0
+				for _, move := range moves {
+					nextRow := r + move.x
+					nextCol := c + move.y
+					if nextRow >= 0 && nextRow < 8 && nextCol >= 0 && nextCol < 8 {
+						p += probs[nextRow][nextCol][step-1] / 8.0
+					}
+				}
+				probs[r][c][step] = p
+			}
+		}
+	}
+	return probs[row][col][k]
+}


Test patch:
diff --git a/day304/problem_test.go b/day304/problem_test.go
new file mode 100644
index 0000000..805dbc9
--- /dev/null
+++ b/day304/problem_test.go
@@ -0,0 +1,30 @@
+package day304
+
+import "testing"
+
+// nolint
+var testcases = []struct {
+	row, col, k int
+	expected    float64
+}{
+	{0, 0, 3, 0.125},
+	{3, 3, 1, 1.0},
+	{3, 3, 2, 0.875},
+}
+
+func TestProbKnightOnBoard(t *testing.T) {
+	t.Parallel()
+	for _, tc := range testcases {
+		if result := ProbKnightOnBoard(tc.row, tc.col, tc.k); result != tc.expected {
+			t.Errorf("Expected %v, got %v", tc.expected, result)
+		}
+	}
+}
+
+func BenchmarkProbKnightOnBoard(b *testing.B) {
+	for i := 0; i < b.N; i++ {
+		for _, tc := range testcases {
+			ProbKnightOnBoard(tc.row, tc.col, tc.k)
+		}
+	}
+}
Repository: buxlabs/boxwood (js)

Issue:
Add an error when `<script routes>` is used but routes are not provided to compilerOptions

Pull request:
Better error handling when script[routes] is used but routes are not set up yet
Closes #627 

Patch:
diff --git a/src/plugins/RoutesPlugin.js b/src/plugins/RoutesPlugin.js
index 3749df5..db73893 100644
--- a/src/plugins/RoutesPlugin.js
+++ b/src/plugins/RoutesPlugin.js
@@ -12,8 +12,10 @@ class RoutesPlugin extends Plugin {
   }
 
   prerun ({ tag, keys, fragment }) {
-    if (this.disabled) { return }
     if (tag === 'script' && keys.includes('routes')) {
+      if (this.disabled) {
+        return this.errors.push({ type: 'EMPTY_ROUTES', message: 'You need to set up routes in compiler options.' })
+      }
       const { content } = fragment.children[0]
       // TODO implement routes.has(, routes.each(
       if (content.includes('routes.get(')) {


Test patch:
diff --git a/test/spec/features/routes.spec.js b/test/spec/features/routes.spec.js
new file mode 100644
index 0000000..2da639e
--- /dev/null
+++ b/test/spec/features/routes.spec.js
@@ -0,0 +1,9 @@
+const test = require('ava')
+const compile = require('../../helpers/compile')
+const { escape } = require('../../..')
+
+test('it returns an error when routes are not set and script[routes] is used', async assert => {
+  const { errors } = await compile('<script routes>routes.get("foo.bar")</script>')
+  assert.deepEqual(errors.length, 1)
+  assert.deepEqual(errors[0].type, 'EMPTY_ROUTES')
+})
Repository: Modernizr/Modernizr (js)

Issue:
Rel Prefetch Support?
Any chance we could get a detect for rel prefetch? It'd be super-helpful for WebKit browsers. There's a [bug out for it](https://bugs.webkit.org/show_bug.cgi?id=194539) now, but no movement yet.

Pull request:
Add detect/tests for prefetch
Closes #2536

- Made a detect for prefetch based on https://github.com/w3c/preload/issues/7
- Added general test and caniuse test

Patch:
diff --git a/feature-detects/link/prefetch.js b/feature-detects/link/prefetch.js
new file mode 100644
index 00000000..66e0b4b0
--- /dev/null
+++ b/feature-detects/link/prefetch.js
@@ -0,0 +1,33 @@
+/*!
+{
+  "name": "rel=prefetch",
+  "property": "prefetch",
+  "caniuse": "link-rel-prefetch",
+  "notes": [{
+    "name": "W3C Spec",
+    "href": "https://www.w3.org/TR/resource-hints/#prefetch"
+  }, {
+    "name": "Related Github Issue",
+    "href": "https://github.com/Modernizr/Modernizr/issues/2536"
+  }]
+}
+!*/
+/* DOC
+Test for resource hints: prefetch.
+*/
+define(["Modernizr", "createElement"], function (Modernizr, createElement) {
+  Modernizr.addTest("prefetch", function() {
+    if (document.documentMode === 11) {
+      // Need to check specifically for IE11 as it supports prefetch, but not relList
+      // https://github.com/Modernizr/Modernizr/pull/2610#issuecomment-709717161
+      return true;
+    }
+
+    var relList = createElement("link").relList;
+    if (!relList || !relList.supports) {
+      return false;
+    }
+
+    return relList.supports("prefetch");
+  });
+});
diff --git a/lib/config-all.json b/lib/config-all.json
index afa6afa5..5dc9ae5d 100644
--- a/lib/config-all.json
+++ b/lib/config-all.json
@@ -264,6 +264,7 @@
     "proxy",
     "queryselector",
     "quota-management-api",
+    "link/prefetch",
     "requestanimationframe",
     "script/async",
     "script/defer",


Test patch:
diff --git a/test/browser/integration/caniuse.js b/test/browser/integration/caniuse.js
index c4fabe10..57ce81b4 100644
--- a/test/browser/integration/caniuse.js
+++ b/test/browser/integration/caniuse.js
@@ -124,6 +124,7 @@ window.caniusecb = function(caniuse) {
       picture: 'picture',
       pointerevents: 'pointer',
       postmessage: 'x-doc-messaging',
+      prefetch: 'link-rel-prefetch',
       progressbar: 'progress',
       promises: 'promises',
       proximity: 'proximity',
Repository: webpack-contrib/copy-webpack-plugin (js)

Issue:
toType detection has broken "to: '[1]'"
* Operating System: MacOS
* Node Version: 10.15.3
* NPM Version: 6.9.0
* webpack Version: 4.29.6
* copy-webpack-plugin Version: 5.0.2

### Expected Behavior

You should be able to specify a to: like '[1]' or 'foo/[1]'.

### Actual Behavior

Files are being put in a literal directory named '[1]'.

### Code

I believe this is caused somewhere in this change: https://github.com/webpack-contrib/copy-webpack-plugin/commit/52f8be6809ae0b876225973d34ff65a3b6009192

I apologize for not submitting a PR instead, as that is my preferred way to deal with bugs, but I do not have time to dig on this right now.

### How Do We Reproduce?

Create a to: setting of '[1]' that is a replacement from a RegExp test.

Pull request:
fix: alone `[N]` interpolation in `to` option
<!--
  HOLY CRAP a Pull Request. We ❤️ those!

  If you remove or skip this template, you'll make the 🐼 sad and the mighty god
  of Github will appear and pile-drive the close button from a great height
  while making animal noises.

  Please place an x (no spaces!) in all [ ] that apply
-->

This PR contains a:

- [x] **bugfix**
- [ ] new **feature**
- [ ] **code refactor**
- [x] **test update** <!-- if bug or feature is checked, this should be too -->
- [ ] **typo fix**
- [ ] **metadata update**

### Motivation / Use-Case

fix bug

### Breaking Changes

No

### Additional Info

fixes #369 fixes #373

Patch:
diff --git a/src/utils/isTemplateLike.js b/src/utils/isTemplateLike.js
index ead6d5c..a06b396 100644
--- a/src/utils/isTemplateLike.js
+++ b/src/utils/isTemplateLike.js
@@ -1,4 +1,4 @@
 export default (pattern) =>
-  /(\[ext\])|(\[name\])|(\[path\])|(\[folder\])|(\[emoji(?::(\d+))?\])|(\[(?:([^:\]]+):)?(?:hash|contenthash)(?::([a-z]+\d*))?(?::(\d+))?\])/.test(
+  /(\[ext\])|(\[name\])|(\[path\])|(\[folder\])|(\[emoji(?::(\d+))?\])|(\[(?:([^:\]]+):)?(?:hash|contenthash)(?::([a-z]+\d*))?(?::(\d+))?\])|(\[\d+\])/.test(
     pattern
   );


Test patch:
diff --git a/test/CopyPlugin.test.js b/test/CopyPlugin.test.js
index 24ab24f..4e834a6 100644
--- a/test/CopyPlugin.test.js
+++ b/test/CopyPlugin.test.js
@@ -1808,6 +1808,21 @@ describe('apply function', () => {
         .catch(done);
     });
 
+    it('can move multiple files to a non-root directory with [1]', (done) => {
+      runEmit({
+        expectedAssetKeys: ['nested/txt'],
+        patterns: [
+          {
+            from: 'directory/nested/deep-nested',
+            to: 'nested/[1]',
+            test: /\.(.*)$/,
+          },
+        ],
+      })
+        .then(done)
+        .catch(done);
+    });
+
     it("can move a directory's contents to the root directory from symbolic link", (done) => {
       runEmit({
         // Windows doesn't support symbolic link
Repository: vaskoz/dailycodingproblem-go (go)

Issue:
Day 92
Good morning! Here's your coding interview problem for today.

This problem was asked by Airbnb.

We're given a hashmap with a key courseId and value a list of courseIds, which represents that the prerequsite of courseId is courseIds. Return a sorted ordering of courses such that we can finish all courses.

Return null if there is no such ordering.

For example, given `{'CSC300': ['CSC100', 'CSC200'], 'CSC200': ['CSC100'], 'CSC100': []}, should return ['CSC100', 'CSC200', 'CSC300']`.

Pull request:
Day92
Resolves #194.

Patch:
diff --git a/README.md b/README.md
index dbbf95a..70585dd 100644
--- a/README.md
+++ b/README.md
@@ -101,3 +101,4 @@ problems from
 * [Day 89](https://github.com/vaskoz/dailycodingproblem-go/issues/187)
 * [Day 90](https://github.com/vaskoz/dailycodingproblem-go/issues/189)
 * [Day 91](https://github.com/vaskoz/dailycodingproblem-go/issues/192)
+* [Day 92](https://github.com/vaskoz/dailycodingproblem-go/issues/194)
diff --git a/day92/problem.go b/day92/problem.go
new file mode 100644
index 0000000..16d957a
--- /dev/null
+++ b/day92/problem.go
@@ -0,0 +1,45 @@
+package day92
+
+// CourseOrder returns how to take all the courses.
+// If it's not possible to take all the courses, returns nil.
+// Runs in O(N) time.
+func CourseOrder(prereq map[string][]string) []string {
+	var result []string
+	marked := make(map[string]int)
+	for n := range prereq {
+		if _, found := marked[n]; !found {
+			newest := visit(n, prereq, marked, result)
+			if len(newest) > len(result) {
+				result = newest
+			}
+		}
+	}
+	if len(marked) != len(prereq) {
+		return nil
+	}
+	reverse(result)
+	return result
+}
+
+func reverse(n []string) {
+	for i := 0; i < len(n)/2; i++ {
+		n[i], n[len(n)-1-i] = n[len(n)-1-i], n[i]
+	}
+}
+
+func visit(node string, graph map[string][]string,
+	marked map[string]int, result []string) []string {
+	if mark := marked[node]; mark != 0 {
+		return nil
+	}
+	marked[node] = 1
+	for _, m := range graph[node] {
+		newest := visit(m, graph, marked, result)
+		if len(newest) > len(result) {
+			result = newest
+		}
+	}
+	marked[node] = 2
+	result = append([]string{node}, result...)
+	return result
+}


Test patch:
diff --git a/day92/problem_test.go b/day92/problem_test.go
new file mode 100644
index 0000000..1560f4a
--- /dev/null
+++ b/day92/problem_test.go
@@ -0,0 +1,40 @@
+package day92
+
+import (
+	"reflect"
+	"testing"
+)
+
+var testcases = []struct {
+	prereqs  map[string][]string
+	expected []string
+}{
+	{map[string][]string{
+		"CSC300": {"CSC100", "CSC200"},
+		"CSC200": {"CSC100"},
+		"CSC100": {},
+	},
+		[]string{"CSC100", "CSC200", "CSC300"}},
+	{map[string][]string{
+		"CSC300": {"CSC100"},
+		"CSC400": {"CSC200"},
+	},
+		nil},
+}
+
+func TestCourseOrder(t *testing.T) {
+	t.Parallel()
+	for _, tc := range testcases {
+		if result := CourseOrder(tc.prereqs); !reflect.DeepEqual(result, tc.expected) {
+			t.Errorf("Expected %v got %v", tc.expected, result)
+		}
+	}
+}
+
+func BenchmarkCourseOrder(b *testing.B) {
+	for i := 0; i < b.N; i++ {
+		for _, tc := range testcases {
+			CourseOrder(tc.prereqs)
+		}
+	}
+}