<commit_before>package katas.kotlin.leetcode.course_schedule

import kotlincommon.test.shouldEqual
import org.junit.Test

class CourseScheduleTests {
    @Test fun `determine if it's possible to finish all courses`() {
        canFinish(n = 2, deps = emptyList()) shouldEqual true
    }
}

private fun canFinish(n: Int, deps: List<Pair<Int, Int>>): Boolean {
    val graph = Graph(n, deps)
    val processed = HashSet<Int>()
    (0 until n).forEach { course ->
        if (!processed.contains(course)) {
            val visited = HashSet<Int>()
            if (graph.canFinish(course, visited)) processed.addAll(visited)<commit_msg>course schedule<commit_after>package katas.kotlin.leetcode.course_schedule

import kotlincommon.test.shouldEqual
import org.junit.Test

class CourseScheduleTests {
    @Test fun `determine if it's possible to finish all courses`() {
        canFinish(n = 0, deps = emptyList()) shouldEqual true
        canFinish(n = 1, deps = emptyList()) shouldEqual true
        canFinish(n = 2, deps = emptyList()) shouldEqual true
    }
}

private fun canFinish(n: Int, deps: List<Pair<Int, Int>>): Boolean {
    val graph = Graph(n, deps)
    val processed = HashSet<Int>()
    (0 until n).forEach { course ->
        if (!processed.contains(course)) {
            val visited = HashSet<Int>()
            if (graph.canFinish(course, visited)) processed.addAll(visited)
{'fraction_non_alphanumeric': 0.11798561151079137, 'fraction_numerical': 0.004316546762589928, 'mean_word_length': 3.4583333333333335, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2404473', 'n_tokens_mistral': 436, 'n_tokens_neox': 416, 'n_words': 116}