From 971d24174797e2788ed97882d0f4b10a10c746ca Mon Sep 17 00:00:00 2001 From: Valentyn Kolesnikov Date: Thu, 21 Nov 2024 20:38:41 +0200 Subject: [PATCH 1/2] Improved mysql tasks --- .../kotlin/g0101_0200/s0175_combine_two_tables/MysqlTest.kt | 2 +- src/test/kotlin/g0201_0300/s0262_trips_and_users/MysqlTest.kt | 2 +- .../kotlin/g0501_0600/s0511_game_play_analysis_i/MysqlTest.kt | 2 +- .../kotlin/g0501_0600/s0550_game_play_analysis_iv/MysqlTest.kt | 2 +- .../kotlin/g0501_0600/s0584_find_customer_referee/MysqlTest.kt | 2 +- .../MysqlTest.kt | 2 +- src/test/kotlin/g0601_0700/s0607_sales_person/MysqlTest.kt | 2 +- .../kotlin/g0601_0700/s0610_triangle_judgement/MysqlTest.kt | 2 +- .../kotlin/g0601_0700/s0619_biggest_single_number/MysqlTest.kt | 2 +- .../MysqlTest.kt | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/test/kotlin/g0101_0200/s0175_combine_two_tables/MysqlTest.kt b/src/test/kotlin/g0101_0200/s0175_combine_two_tables/MysqlTest.kt index 2873c70da..a4a89c794 100644 --- a/src/test/kotlin/g0101_0200/s0175_combine_two_tables/MysqlTest.kt +++ b/src/test/kotlin/g0101_0200/s0175_combine_two_tables/MysqlTest.kt @@ -34,7 +34,7 @@ internal class MysqlTest { @Test @Throws(SQLException::class, FileNotFoundException::class) fun testScript(@EmbeddedDatabase dataSource: DataSource) { - dataSource.getConnection().use { connection -> + dataSource.connection.use { connection -> connection.createStatement().use { statement -> statement.executeQuery( BufferedReader( diff --git a/src/test/kotlin/g0201_0300/s0262_trips_and_users/MysqlTest.kt b/src/test/kotlin/g0201_0300/s0262_trips_and_users/MysqlTest.kt index 7828c59c3..415c672c7 100644 --- a/src/test/kotlin/g0201_0300/s0262_trips_and_users/MysqlTest.kt +++ b/src/test/kotlin/g0201_0300/s0262_trips_and_users/MysqlTest.kt @@ -53,7 +53,7 @@ internal class MysqlTest { @Test @Throws(SQLException::class, FileNotFoundException::class) fun testScript(@EmbeddedDatabase dataSource: DataSource) { - dataSource.getConnection().use { connection -> + dataSource.connection.use { connection -> connection.createStatement().use { statement -> statement.executeQuery( BufferedReader( diff --git a/src/test/kotlin/g0501_0600/s0511_game_play_analysis_i/MysqlTest.kt b/src/test/kotlin/g0501_0600/s0511_game_play_analysis_i/MysqlTest.kt index f19db2365..fe7d5ef0c 100644 --- a/src/test/kotlin/g0501_0600/s0511_game_play_analysis_i/MysqlTest.kt +++ b/src/test/kotlin/g0501_0600/s0511_game_play_analysis_i/MysqlTest.kt @@ -34,7 +34,7 @@ internal class MysqlTest { @Test @Throws(SQLException::class, FileNotFoundException::class) fun testScript(@EmbeddedDatabase dataSource: DataSource) { - dataSource.getConnection().use { connection -> + dataSource.connection.use { connection -> connection.createStatement().use { statement -> statement.executeQuery( BufferedReader( diff --git a/src/test/kotlin/g0501_0600/s0550_game_play_analysis_iv/MysqlTest.kt b/src/test/kotlin/g0501_0600/s0550_game_play_analysis_iv/MysqlTest.kt index 3f4de460f..359e46544 100644 --- a/src/test/kotlin/g0501_0600/s0550_game_play_analysis_iv/MysqlTest.kt +++ b/src/test/kotlin/g0501_0600/s0550_game_play_analysis_iv/MysqlTest.kt @@ -39,7 +39,7 @@ internal class MysqlTest { @Test @Throws(SQLException::class, FileNotFoundException::class) fun testScript(@EmbeddedDatabase dataSource: DataSource) { - dataSource.getConnection().use { connection -> + dataSource.connection.use { connection -> connection.createStatement().use { statement -> statement.executeQuery( BufferedReader( diff --git a/src/test/kotlin/g0501_0600/s0584_find_customer_referee/MysqlTest.kt b/src/test/kotlin/g0501_0600/s0584_find_customer_referee/MysqlTest.kt index d05267186..302a602e3 100644 --- a/src/test/kotlin/g0501_0600/s0584_find_customer_referee/MysqlTest.kt +++ b/src/test/kotlin/g0501_0600/s0584_find_customer_referee/MysqlTest.kt @@ -29,7 +29,7 @@ internal class MysqlTest { @Test @Throws(SQLException::class, FileNotFoundException::class) fun testScript(@EmbeddedDatabase dataSource: DataSource) { - dataSource.getConnection().use { connection -> + dataSource.connection.use { connection -> connection.createStatement().use { statement -> statement.executeQuery( BufferedReader( diff --git a/src/test/kotlin/g0601_0700/s0602_friend_requests_ii_who_has_the_most_friends/MysqlTest.kt b/src/test/kotlin/g0601_0700/s0602_friend_requests_ii_who_has_the_most_friends/MysqlTest.kt index 3a4281d95..001c55ea6 100644 --- a/src/test/kotlin/g0601_0700/s0602_friend_requests_ii_who_has_the_most_friends/MysqlTest.kt +++ b/src/test/kotlin/g0601_0700/s0602_friend_requests_ii_who_has_the_most_friends/MysqlTest.kt @@ -31,7 +31,7 @@ internal class MysqlTest { @Test @Throws(SQLException::class, FileNotFoundException::class) fun testScript(@EmbeddedDatabase dataSource: DataSource) { - dataSource.getConnection().use { connection -> + dataSource.connection.use { connection -> connection.createStatement().use { statement -> statement.executeQuery( BufferedReader( diff --git a/src/test/kotlin/g0601_0700/s0607_sales_person/MysqlTest.kt b/src/test/kotlin/g0601_0700/s0607_sales_person/MysqlTest.kt index a844d9e3e..8a67035b4 100644 --- a/src/test/kotlin/g0601_0700/s0607_sales_person/MysqlTest.kt +++ b/src/test/kotlin/g0601_0700/s0607_sales_person/MysqlTest.kt @@ -49,7 +49,7 @@ internal class MysqlTest { @Test @Throws(SQLException::class, FileNotFoundException::class) fun testScript(@EmbeddedDatabase dataSource: DataSource) { - dataSource.getConnection().use { connection -> + dataSource.connection.use { connection -> connection.createStatement().use { statement -> statement.executeQuery( BufferedReader( diff --git a/src/test/kotlin/g0601_0700/s0610_triangle_judgement/MysqlTest.kt b/src/test/kotlin/g0601_0700/s0610_triangle_judgement/MysqlTest.kt index 1fe9265d8..583aecb5c 100644 --- a/src/test/kotlin/g0601_0700/s0610_triangle_judgement/MysqlTest.kt +++ b/src/test/kotlin/g0601_0700/s0610_triangle_judgement/MysqlTest.kt @@ -27,7 +27,7 @@ internal class MysqlTest { @Test @Throws(SQLException::class, FileNotFoundException::class) fun testScript(@EmbeddedDatabase dataSource: DataSource) { - dataSource.getConnection().use { connection -> + dataSource.connection.use { connection -> connection.createStatement().use { statement -> statement.executeQuery( BufferedReader( diff --git a/src/test/kotlin/g0601_0700/s0619_biggest_single_number/MysqlTest.kt b/src/test/kotlin/g0601_0700/s0619_biggest_single_number/MysqlTest.kt index 1c8ea94dd..05d059381 100644 --- a/src/test/kotlin/g0601_0700/s0619_biggest_single_number/MysqlTest.kt +++ b/src/test/kotlin/g0601_0700/s0619_biggest_single_number/MysqlTest.kt @@ -31,7 +31,7 @@ internal class MysqlTest { @Test @Throws(SQLException::class, FileNotFoundException::class) fun testScript(@EmbeddedDatabase dataSource: DataSource) { - dataSource.getConnection().use { connection -> + dataSource.connection.use { connection -> connection.createStatement().use { statement -> statement.executeQuery( BufferedReader( diff --git a/src/test/kotlin/g2301_2400/s2356_number_of_unique_subjects_taught_by_each_teacher/MysqlTest.kt b/src/test/kotlin/g2301_2400/s2356_number_of_unique_subjects_taught_by_each_teacher/MysqlTest.kt index 9d0b36bd6..5bb4b40ad 100644 --- a/src/test/kotlin/g2301_2400/s2356_number_of_unique_subjects_taught_by_each_teacher/MysqlTest.kt +++ b/src/test/kotlin/g2301_2400/s2356_number_of_unique_subjects_taught_by_each_teacher/MysqlTest.kt @@ -38,7 +38,7 @@ internal class MysqlTest { @Test @Throws(SQLException::class, FileNotFoundException::class) fun testScript(@EmbeddedDatabase dataSource: DataSource) { - dataSource.getConnection().use { connection -> + dataSource.connection.use { connection -> connection.createStatement().use { statement -> statement.executeQuery( BufferedReader( From 2f29713bf79a35dba0ba4c6b1442c455630c9355 Mon Sep 17 00:00:00 2001 From: Valentyn Kolesnikov Date: Thu, 21 Nov 2024 21:02:18 +0200 Subject: [PATCH 2/2] Improved tests --- .../s0212_word_search_ii/Solution.kt | 7 ++++--- .../s0212_word_search_ii/SolutionTest.kt | 4 ++-- .../SolutionTest.kt | 4 ++-- .../SolutionTest.kt | 4 ++-- .../SolutionTest.kt | 4 ++-- .../SolutionTest.kt | 4 ++-- .../SolutionTest.kt | 2 +- .../SolutionTest.kt | 4 ++-- .../SolutionTest.kt | 8 ++++---- .../SolutionTest.kt | 8 ++++---- .../SolutionTest.kt | 8 ++++---- .../SolutionTest.kt | 12 +++++------ .../SolutionTest.kt | 16 +++++++-------- .../SolutionTest.kt | 8 ++++---- .../SolutionTest.kt | 20 +++++++++---------- .../SolutionTest.kt | 12 +++++------ .../SolutionTest.kt | 8 ++++---- .../SolutionTest.kt | 12 +++++------ .../SolutionTest.kt | 12 +++++------ .../SolutionTest.kt | 4 ++-- .../SolutionTest.kt | 4 ++-- .../SolutionTest.kt | 8 ++++---- .../SolutionTest.kt | 8 ++++---- .../SolutionTest.kt | 8 ++++---- .../SolutionTest.kt | 16 +++++++-------- .../SolutionTest.kt | 6 +++--- .../SolutionTest.kt | 8 ++++---- .../SolutionTest.kt | 12 +++++------ .../SolutionTest.kt | 4 ++-- .../SolutionTest.kt | 8 ++++---- .../SolutionTest.kt | 6 +++--- .../SolutionTest.kt | 8 ++++---- .../SolutionTest.kt | 6 +++--- .../SolutionTest.kt | 8 ++++---- .../SolutionTest.kt | 4 ++-- .../SolutionTest.kt | 8 ++++---- .../SolutionTest.kt | 4 ++-- .../SolutionTest.kt | 12 +++++------ .../SolutionTest.kt | 12 +++++------ .../SolutionTest.kt | 6 +++--- 40 files changed, 159 insertions(+), 158 deletions(-) diff --git a/src/main/kotlin/g0201_0300/s0212_word_search_ii/Solution.kt b/src/main/kotlin/g0201_0300/s0212_word_search_ii/Solution.kt index 52cfa70b8..e8857e375 100644 --- a/src/main/kotlin/g0201_0300/s0212_word_search_ii/Solution.kt +++ b/src/main/kotlin/g0201_0300/s0212_word_search_ii/Solution.kt @@ -6,13 +6,14 @@ package g0201_0300.s0212_word_search_ii @Suppress("NAME_SHADOWING") class Solution { private var root: Tree? = null - fun findWords(board: Array, words: Array): List { - if (board.size < 1 || board[0].size < 1) { + + fun findWords(board: Array, words: Array): List { + if (board.isEmpty() || board[0].isEmpty()) { return emptyList() } root = Tree() for (word in words) { - Tree.addWord(root, word!!) + Tree.addWord(root, word) } val collected: MutableList = ArrayList() for (i in board.indices) { diff --git a/src/test/kotlin/g0201_0300/s0212_word_search_ii/SolutionTest.kt b/src/test/kotlin/g0201_0300/s0212_word_search_ii/SolutionTest.kt index e40bca830..0babfc37a 100644 --- a/src/test/kotlin/g0201_0300/s0212_word_search_ii/SolutionTest.kt +++ b/src/test/kotlin/g0201_0300/s0212_word_search_ii/SolutionTest.kt @@ -13,7 +13,7 @@ internal class SolutionTest { charArrayOf('i', 'h', 'k', 'r'), charArrayOf('i', 'f', 'l', 'v'), ) - val words = arrayOf("oath", "pea", "eat", "rain") + val words = arrayOf("oath", "pea", "eat", "rain") val expected: MutableList = ArrayList() expected.add("oath") expected.add("eat") @@ -23,7 +23,7 @@ internal class SolutionTest { @Test fun findWords2() { val board = arrayOf(charArrayOf('a', 'b'), charArrayOf('c', 'd')) - val words = arrayOf("abcb") + val words = arrayOf("abcb") assertThat(Solution().findWords(board, words), equalTo(emptyList())) } } diff --git a/src/test/kotlin/g1101_1200/s1145_binary_tree_coloring_game/SolutionTest.kt b/src/test/kotlin/g1101_1200/s1145_binary_tree_coloring_game/SolutionTest.kt index 7cd50b2f3..cdeb1443b 100644 --- a/src/test/kotlin/g1101_1200/s1145_binary_tree_coloring_game/SolutionTest.kt +++ b/src/test/kotlin/g1101_1200/s1145_binary_tree_coloring_game/SolutionTest.kt @@ -8,13 +8,13 @@ import org.junit.jupiter.api.Test internal class SolutionTest { @Test fun btreeGameWinningMove() { - val root = TreeNode.create(mutableListOf(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)) + val root = TreeNode.create(mutableListOf(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)) assertThat(Solution().btreeGameWinningMove(root, 11, 3), equalTo(true)) } @Test fun btreeGameWinningMove2() { - val root = TreeNode.create(mutableListOf(1, 2, 3)) + val root = TreeNode.create(mutableListOf(1, 2, 3)) assertThat(Solution().btreeGameWinningMove(root, 3, 1), equalTo(false)) } } diff --git a/src/test/kotlin/g2401_2500/s2468_split_message_based_on_limit/SolutionTest.kt b/src/test/kotlin/g2401_2500/s2468_split_message_based_on_limit/SolutionTest.kt index e968b8b09..759c18d29 100644 --- a/src/test/kotlin/g2401_2500/s2468_split_message_based_on_limit/SolutionTest.kt +++ b/src/test/kotlin/g2401_2500/s2468_split_message_based_on_limit/SolutionTest.kt @@ -10,7 +10,7 @@ internal class SolutionTest { assertThat( Solution().splitMessage("this is really a very awesome message", 9), equalTo( - arrayOf( + arrayOf( "thi<1/14>", "s i<2/14>", "s r<3/14>", @@ -34,7 +34,7 @@ internal class SolutionTest { fun splitMessage2() { assertThat( Solution().splitMessage("short message", 15), - equalTo(arrayOf("short mess<1/2>", "age<2/2>")), + equalTo(arrayOf("short mess<1/2>", "age<2/2>")), ) } } diff --git a/src/test/kotlin/g2801_2900/s2809_minimum_time_to_make_array_sum_at_most_x/SolutionTest.kt b/src/test/kotlin/g2801_2900/s2809_minimum_time_to_make_array_sum_at_most_x/SolutionTest.kt index 673c52873..333eff407 100644 --- a/src/test/kotlin/g2801_2900/s2809_minimum_time_to_make_array_sum_at_most_x/SolutionTest.kt +++ b/src/test/kotlin/g2801_2900/s2809_minimum_time_to_make_array_sum_at_most_x/SolutionTest.kt @@ -8,7 +8,7 @@ internal class SolutionTest { @Test fun minimumTime() { assertThat( - Solution().minimumTime(mutableListOf(1, 2, 3), mutableListOf(1, 2, 3), 4), + Solution().minimumTime(mutableListOf(1, 2, 3), mutableListOf(1, 2, 3), 4), equalTo(3), ) } @@ -16,7 +16,7 @@ internal class SolutionTest { @Test fun minimumTime2() { assertThat( - Solution().minimumTime(mutableListOf(1, 2, 3), mutableListOf(3, 3, 3), 4), + Solution().minimumTime(mutableListOf(1, 2, 3), mutableListOf(3, 3, 3), 4), equalTo(-1), ) } diff --git a/src/test/kotlin/g2801_2900/s2818_apply_operations_to_maximize_score/SolutionTest.kt b/src/test/kotlin/g2801_2900/s2818_apply_operations_to_maximize_score/SolutionTest.kt index 54b72a5c9..cc52d2548 100644 --- a/src/test/kotlin/g2801_2900/s2818_apply_operations_to_maximize_score/SolutionTest.kt +++ b/src/test/kotlin/g2801_2900/s2818_apply_operations_to_maximize_score/SolutionTest.kt @@ -8,7 +8,7 @@ internal class SolutionTest { @Test fun maximumScore() { assertThat( - Solution().maximumScore(mutableListOf(8, 3, 9, 3, 8), 2), + Solution().maximumScore(mutableListOf(8, 3, 9, 3, 8), 2), equalTo(81), ) } @@ -16,7 +16,7 @@ internal class SolutionTest { @Test fun maximumScore2() { assertThat( - Solution().maximumScore(mutableListOf(19, 12, 14, 6, 10, 18), 3), + Solution().maximumScore(mutableListOf(19, 12, 14, 6, 10, 18), 3), equalTo(4788), ) } diff --git a/src/test/kotlin/g2901_3000/s2966_divide_array_into_arrays_with_max_difference/SolutionTest.kt b/src/test/kotlin/g2901_3000/s2966_divide_array_into_arrays_with_max_difference/SolutionTest.kt index 585343496..a5f404b4e 100644 --- a/src/test/kotlin/g2901_3000/s2966_divide_array_into_arrays_with_max_difference/SolutionTest.kt +++ b/src/test/kotlin/g2901_3000/s2966_divide_array_into_arrays_with_max_difference/SolutionTest.kt @@ -9,7 +9,7 @@ internal class SolutionTest { fun divideArray() { assertThat( Solution().divideArray(intArrayOf(1, 3, 4, 8, 7, 9, 3, 5, 1), 2), - equalTo(arrayOf(intArrayOf(1, 1, 3), intArrayOf(3, 4, 5), intArrayOf(7, 8, 9))), + equalTo(arrayOf(intArrayOf(1, 1, 3), intArrayOf(3, 4, 5), intArrayOf(7, 8, 9))), ) } diff --git a/src/test/kotlin/g3001_3100/s3076_shortest_uncommon_substring_in_an_array/SolutionTest.kt b/src/test/kotlin/g3001_3100/s3076_shortest_uncommon_substring_in_an_array/SolutionTest.kt index 0af2c9d12..0683249f7 100644 --- a/src/test/kotlin/g3001_3100/s3076_shortest_uncommon_substring_in_an_array/SolutionTest.kt +++ b/src/test/kotlin/g3001_3100/s3076_shortest_uncommon_substring_in_an_array/SolutionTest.kt @@ -9,7 +9,7 @@ internal class SolutionTest { fun shortestSubstrings() { assertThat( Solution().shortestSubstrings(arrayOf("cab", "ad", "bad", "c")), - equalTo(arrayOf("ab", "", "ba", "")), + equalTo(arrayOf("ab", "", "ba", "")), ) } @@ -17,7 +17,7 @@ internal class SolutionTest { fun shortestSubstrings2() { assertThat( Solution().shortestSubstrings(arrayOf("abc", "bcd", "abcd")), - equalTo(arrayOf("", "", "abcd")), + equalTo(arrayOf("", "", "abcd")), ) } } diff --git a/src/test/kotlin/g3201_3300/s3280_convert_date_to_binary/SolutionTest.kt b/src/test/kotlin/g3201_3300/s3280_convert_date_to_binary/SolutionTest.kt index 018aea0f8..8eab1f5a7 100644 --- a/src/test/kotlin/g3201_3300/s3280_convert_date_to_binary/SolutionTest.kt +++ b/src/test/kotlin/g3201_3300/s3280_convert_date_to_binary/SolutionTest.kt @@ -7,17 +7,17 @@ import org.junit.jupiter.api.Test internal class SolutionTest { @Test fun convertDateToBinary() { - assertThat( + assertThat( Solution().convertDateToBinary("2080-02-29"), - equalTo("100000100000-10-11101"), + equalTo("100000100000-10-11101"), ) } @Test fun convertDateToBinary2() { - assertThat( + assertThat( Solution().convertDateToBinary("1900-01-01"), - equalTo("11101101100-1-1"), + equalTo("11101101100-1-1"), ) } } diff --git a/src/test/kotlin/g3201_3300/s3281_maximize_score_of_numbers_in_ranges/SolutionTest.kt b/src/test/kotlin/g3201_3300/s3281_maximize_score_of_numbers_in_ranges/SolutionTest.kt index 568a68d65..a3fc25a34 100644 --- a/src/test/kotlin/g3201_3300/s3281_maximize_score_of_numbers_in_ranges/SolutionTest.kt +++ b/src/test/kotlin/g3201_3300/s3281_maximize_score_of_numbers_in_ranges/SolutionTest.kt @@ -7,17 +7,17 @@ import org.junit.jupiter.api.Test internal class SolutionTest { @Test fun maxPossibleScore() { - assertThat( + assertThat( Solution().maxPossibleScore(intArrayOf(6, 0, 3), 2), - equalTo(4), + equalTo(4), ) } @Test fun maxPossibleScore2() { - assertThat( + assertThat( Solution().maxPossibleScore(intArrayOf(2, 6, 13, 13), 5), - equalTo(5), + equalTo(5), ) } } diff --git a/src/test/kotlin/g3201_3300/s3282_reach_end_of_array_with_max_score/SolutionTest.kt b/src/test/kotlin/g3201_3300/s3282_reach_end_of_array_with_max_score/SolutionTest.kt index 7fcc390fd..405e5e7f6 100644 --- a/src/test/kotlin/g3201_3300/s3282_reach_end_of_array_with_max_score/SolutionTest.kt +++ b/src/test/kotlin/g3201_3300/s3282_reach_end_of_array_with_max_score/SolutionTest.kt @@ -7,17 +7,17 @@ import org.junit.jupiter.api.Test internal class SolutionTest { @Test fun findMaximumScore() { - assertThat( + assertThat( Solution().findMaximumScore(mutableListOf(1, 3, 1, 5)), - equalTo(7L), + equalTo(7L), ) } @Test fun findMaximumScore2() { - assertThat( + assertThat( Solution().findMaximumScore(mutableListOf(4, 3, 1, 3, 2)), - equalTo(16L), + equalTo(16L), ) } } diff --git a/src/test/kotlin/g3201_3300/s3283_maximum_number_of_moves_to_kill_all_pawns/SolutionTest.kt b/src/test/kotlin/g3201_3300/s3283_maximum_number_of_moves_to_kill_all_pawns/SolutionTest.kt index c88205095..d4182a72a 100644 --- a/src/test/kotlin/g3201_3300/s3283_maximum_number_of_moves_to_kill_all_pawns/SolutionTest.kt +++ b/src/test/kotlin/g3201_3300/s3283_maximum_number_of_moves_to_kill_all_pawns/SolutionTest.kt @@ -7,33 +7,33 @@ import org.junit.jupiter.api.Test internal class SolutionTest { @Test fun maxMoves() { - assertThat( + assertThat( Solution().maxMoves(1, 1, arrayOf(intArrayOf(0, 0))), - equalTo(4), + equalTo(4), ) } @Test fun maxMoves2() { - assertThat( + assertThat( Solution().maxMoves( 0, 2, arrayOf(intArrayOf(1, 1), intArrayOf(2, 2), intArrayOf(3, 3)), ), - equalTo(8), + equalTo(8), ) } @Test fun maxMoves3() { - assertThat( + assertThat( Solution().maxMoves( 0, 0, arrayOf(intArrayOf(1, 2), intArrayOf(2, 4)), ), - equalTo(3), + equalTo(3), ) } } diff --git a/src/test/kotlin/g3201_3300/s3286_find_a_safe_walk_through_a_grid/SolutionTest.kt b/src/test/kotlin/g3201_3300/s3286_find_a_safe_walk_through_a_grid/SolutionTest.kt index 58faf37ae..698d1e651 100644 --- a/src/test/kotlin/g3201_3300/s3286_find_a_safe_walk_through_a_grid/SolutionTest.kt +++ b/src/test/kotlin/g3201_3300/s3286_find_a_safe_walk_through_a_grid/SolutionTest.kt @@ -1,14 +1,14 @@ package g3201_3300.s3286_find_a_safe_walk_through_a_grid import com_github_leetcode.ArrayUtils.getLists -import org.hamcrest.CoreMatchers -import org.hamcrest.MatcherAssert +import org.hamcrest.CoreMatchers.equalTo +import org.hamcrest.MatcherAssert.assertThat import org.junit.jupiter.api.Test internal class SolutionTest { @Test fun findSafeWalk() { - MatcherAssert.assertThat( + assertThat( Solution() .findSafeWalk( getLists( @@ -20,13 +20,13 @@ internal class SolutionTest { ), 1, ), - CoreMatchers.equalTo(true), + equalTo(true), ) } @Test fun findSafeWalk2() { - MatcherAssert.assertThat( + assertThat( Solution() .findSafeWalk( getLists( @@ -39,13 +39,13 @@ internal class SolutionTest { ), 3, ), - CoreMatchers.equalTo(false), + equalTo(false), ) } @Test fun findSafeWalk3() { - MatcherAssert.assertThat( + assertThat( Solution() .findSafeWalk( getLists( @@ -57,7 +57,7 @@ internal class SolutionTest { ), 5, ), - CoreMatchers.equalTo(true), + equalTo(true), ) } } diff --git a/src/test/kotlin/g3201_3300/s3287_find_the_maximum_sequence_value_of_array/SolutionTest.kt b/src/test/kotlin/g3201_3300/s3287_find_the_maximum_sequence_value_of_array/SolutionTest.kt index ad6e34be7..e524e8965 100644 --- a/src/test/kotlin/g3201_3300/s3287_find_the_maximum_sequence_value_of_array/SolutionTest.kt +++ b/src/test/kotlin/g3201_3300/s3287_find_the_maximum_sequence_value_of_array/SolutionTest.kt @@ -1,17 +1,17 @@ package g3201_3300.s3287_find_the_maximum_sequence_value_of_array -import org.hamcrest.CoreMatchers -import org.hamcrest.MatcherAssert +import org.hamcrest.CoreMatchers.equalTo +import org.hamcrest.MatcherAssert.assertThat import org.junit.jupiter.api.Test internal class SolutionTest { @Test fun maxValue() { - MatcherAssert.assertThat(Solution().maxValue(intArrayOf(2, 6, 7), 1), CoreMatchers.equalTo(5)) + assertThat(Solution().maxValue(intArrayOf(2, 6, 7), 1), equalTo(5)) } @Test fun maxValue2() { - MatcherAssert.assertThat(Solution().maxValue(intArrayOf(4, 2, 5, 6, 7), 2), CoreMatchers.equalTo(2)) + assertThat(Solution().maxValue(intArrayOf(4, 2, 5, 6, 7), 2), equalTo(2)) } } diff --git a/src/test/kotlin/g3201_3300/s3288_length_of_the_longest_increasing_path/SolutionTest.kt b/src/test/kotlin/g3201_3300/s3288_length_of_the_longest_increasing_path/SolutionTest.kt index b0e781e2e..8292f35f4 100644 --- a/src/test/kotlin/g3201_3300/s3288_length_of_the_longest_increasing_path/SolutionTest.kt +++ b/src/test/kotlin/g3201_3300/s3288_length_of_the_longest_increasing_path/SolutionTest.kt @@ -7,7 +7,7 @@ import org.junit.jupiter.api.Test internal class SolutionTest { @Test fun maxPathLength() { - assertThat( + assertThat( Solution() .maxPathLength( arrayOf( @@ -19,29 +19,29 @@ internal class SolutionTest { ), 1, ), - equalTo(3), + equalTo(3), ) } @Test fun maxPathLength2() { - assertThat( + assertThat( Solution().maxPathLength(arrayOf(intArrayOf(2, 1), intArrayOf(7, 0), intArrayOf(5, 6)), 2), - equalTo(2), + equalTo(2), ) } @Test fun maxPathLength3() { - assertThat( + assertThat( Solution().maxPathLength(arrayOf(intArrayOf(0, 3), intArrayOf(8, 5), intArrayOf(6, 8)), 0), - equalTo(2), + equalTo(2), ) } @Test fun maxPathLength4() { - assertThat( + assertThat( Solution().maxPathLength( arrayOf( intArrayOf(8, 8), @@ -51,13 +51,13 @@ internal class SolutionTest { ), 0, ), - equalTo(2), + equalTo(2), ) } @Test fun maxPathLength5() { - assertThat( + assertThat( Solution() .maxPathLength( arrayOf( @@ -71,7 +71,7 @@ internal class SolutionTest { ), 6, ), - equalTo(4), + equalTo(4), ) } } diff --git a/src/test/kotlin/g3201_3300/s3289_the_two_sneaky_numbers_of_digitville/SolutionTest.kt b/src/test/kotlin/g3201_3300/s3289_the_two_sneaky_numbers_of_digitville/SolutionTest.kt index ea3541a44..1a64e3952 100644 --- a/src/test/kotlin/g3201_3300/s3289_the_two_sneaky_numbers_of_digitville/SolutionTest.kt +++ b/src/test/kotlin/g3201_3300/s3289_the_two_sneaky_numbers_of_digitville/SolutionTest.kt @@ -7,25 +7,25 @@ import org.junit.jupiter.api.Test internal class SolutionTest { @Test fun getSneakyNumbers() { - assertThat( + assertThat( Solution().getSneakyNumbers(intArrayOf(0, 1, 1, 0)), - equalTo(intArrayOf(0, 1)), + equalTo(intArrayOf(0, 1)), ) } @Test fun getSneakyNumbers2() { - assertThat( + assertThat( Solution().getSneakyNumbers(intArrayOf(0, 3, 2, 1, 3, 2)), - equalTo(intArrayOf(2, 3)), + equalTo(intArrayOf(2, 3)), ) } @Test fun getSneakyNumbers3() { - assertThat( + assertThat( Solution().getSneakyNumbers(intArrayOf(7, 1, 5, 4, 3, 4, 6, 0, 9, 5, 8, 2)), - equalTo(intArrayOf(4, 5)), + equalTo(intArrayOf(4, 5)), ) } } diff --git a/src/test/kotlin/g3201_3300/s3290_maximum_multiplication_score/SolutionTest.kt b/src/test/kotlin/g3201_3300/s3290_maximum_multiplication_score/SolutionTest.kt index b6a115801..245e3c0f9 100644 --- a/src/test/kotlin/g3201_3300/s3290_maximum_multiplication_score/SolutionTest.kt +++ b/src/test/kotlin/g3201_3300/s3290_maximum_multiplication_score/SolutionTest.kt @@ -7,18 +7,18 @@ import org.junit.jupiter.api.Test internal class SolutionTest { @Test fun maxScore() { - assertThat( + assertThat( Solution() .maxScore(intArrayOf(3, 2, 5, 6), intArrayOf(2, -6, 4, -5, -3, 2, -7)), - equalTo(26L), + equalTo(26L), ) } @Test fun maxScore2() { - assertThat( + assertThat( Solution().maxScore(intArrayOf(-1, 4, 5, -2), intArrayOf(-5, -1, -3, -2, -4)), - equalTo(-1L), + equalTo(-1L), ) } } diff --git a/src/test/kotlin/g3201_3300/s3291_minimum_number_of_valid_strings_to_form_target_i/SolutionTest.kt b/src/test/kotlin/g3201_3300/s3291_minimum_number_of_valid_strings_to_form_target_i/SolutionTest.kt index 6dd52e7e2..9cb2f8141 100644 --- a/src/test/kotlin/g3201_3300/s3291_minimum_number_of_valid_strings_to_form_target_i/SolutionTest.kt +++ b/src/test/kotlin/g3201_3300/s3291_minimum_number_of_valid_strings_to_form_target_i/SolutionTest.kt @@ -7,25 +7,25 @@ import org.junit.jupiter.api.Test internal class SolutionTest { @Test fun minValidStrings() { - assertThat( + assertThat( Solution().minValidStrings(arrayOf("abc", "aaaaa", "bcdef"), "aabcdabc"), - equalTo(3), + equalTo(3), ) } @Test fun minValidStrings2() { - assertThat( + assertThat( Solution().minValidStrings(arrayOf("abababab", "ab"), "ababaababa"), - equalTo(2), + equalTo(2), ) } @Test fun minValidStrings3() { - assertThat( + assertThat( Solution().minValidStrings(arrayOf("abcdef"), "xyz"), - equalTo(-1), + equalTo(-1), ) } } diff --git a/src/test/kotlin/g3201_3300/s3292_minimum_number_of_valid_strings_to_form_target_ii/SolutionTest.kt b/src/test/kotlin/g3201_3300/s3292_minimum_number_of_valid_strings_to_form_target_ii/SolutionTest.kt index ca2d30c46..977da39b1 100644 --- a/src/test/kotlin/g3201_3300/s3292_minimum_number_of_valid_strings_to_form_target_ii/SolutionTest.kt +++ b/src/test/kotlin/g3201_3300/s3292_minimum_number_of_valid_strings_to_form_target_ii/SolutionTest.kt @@ -7,25 +7,25 @@ import org.junit.jupiter.api.Test internal class SolutionTest { @Test fun minValidStrings() { - assertThat( + assertThat( Solution().minValidStrings(arrayOf("abc", "aaaaa", "bcdef"), "aabcdabc"), - equalTo(3), + equalTo(3), ) } @Test fun minValidStrings2() { - assertThat( + assertThat( Solution().minValidStrings(arrayOf("abababab", "ab"), "ababaababa"), - equalTo(2), + equalTo(2), ) } @Test fun minValidStrings3() { - assertThat( + assertThat( Solution().minValidStrings(arrayOf("abcdef"), "xyz"), - equalTo(-1), + equalTo(-1), ) } } diff --git a/src/test/kotlin/g3301_3400/s3303_find_the_occurrence_of_first_almost_equal_substring/SolutionTest.kt b/src/test/kotlin/g3301_3400/s3303_find_the_occurrence_of_first_almost_equal_substring/SolutionTest.kt index 5a959e09c..1c9a34a7b 100644 --- a/src/test/kotlin/g3301_3400/s3303_find_the_occurrence_of_first_almost_equal_substring/SolutionTest.kt +++ b/src/test/kotlin/g3301_3400/s3303_find_the_occurrence_of_first_almost_equal_substring/SolutionTest.kt @@ -20,11 +20,11 @@ internal class SolutionTest { @Test fun minStartingIndex3() { - assertThat(Solution().minStartingIndex("abcd", "dba"), equalTo(-1)) + assertThat(Solution().minStartingIndex("abcd", "dba"), equalTo(-1)) } @Test fun minStartingIndex4() { - assertThat(Solution().minStartingIndex("dde", "d"), equalTo(0)) + assertThat(Solution().minStartingIndex("dde", "d"), equalTo(0)) } } diff --git a/src/test/kotlin/g3301_3400/s3309_maximum_possible_number_by_binary_concatenation/SolutionTest.kt b/src/test/kotlin/g3301_3400/s3309_maximum_possible_number_by_binary_concatenation/SolutionTest.kt index b741c0aac..2e9509f5f 100644 --- a/src/test/kotlin/g3301_3400/s3309_maximum_possible_number_by_binary_concatenation/SolutionTest.kt +++ b/src/test/kotlin/g3301_3400/s3309_maximum_possible_number_by_binary_concatenation/SolutionTest.kt @@ -7,11 +7,11 @@ import org.junit.jupiter.api.Test internal class SolutionTest { @Test fun maxGoodNumber() { - assertThat(Solution().maxGoodNumber(intArrayOf(1, 2, 3)), equalTo(30)) + assertThat(Solution().maxGoodNumber(intArrayOf(1, 2, 3)), equalTo(30)) } @Test fun maxGoodNumber2() { - assertThat(Solution().maxGoodNumber(intArrayOf(2, 8, 16)), equalTo(1296)) + assertThat(Solution().maxGoodNumber(intArrayOf(2, 8, 16)), equalTo(1296)) } } diff --git a/src/test/kotlin/g3301_3400/s3312_sorted_gcd_pair_queries/SolutionTest.kt b/src/test/kotlin/g3301_3400/s3312_sorted_gcd_pair_queries/SolutionTest.kt index 986272a32..276717ab8 100644 --- a/src/test/kotlin/g3301_3400/s3312_sorted_gcd_pair_queries/SolutionTest.kt +++ b/src/test/kotlin/g3301_3400/s3312_sorted_gcd_pair_queries/SolutionTest.kt @@ -7,17 +7,17 @@ import org.junit.jupiter.api.Test internal class SolutionTest { @Test fun gcdValues() { - assertThat( + assertThat( Solution().gcdValues(intArrayOf(2, 3, 4), longArrayOf(0L, 2L, 2L)), - equalTo(intArrayOf(1, 2, 2)), + equalTo(intArrayOf(1, 2, 2)), ) } @Test fun gcdValues2() { - assertThat( + assertThat( Solution().gcdValues(intArrayOf(4, 4, 2, 1), longArrayOf(5L, 3L, 1L, 0L)), - equalTo(intArrayOf(4, 2, 1, 1)), + equalTo(intArrayOf(4, 2, 1, 1)), ) } } diff --git a/src/test/kotlin/g3301_3400/s3314_construct_the_minimum_bitwise_array_i/SolutionTest.kt b/src/test/kotlin/g3301_3400/s3314_construct_the_minimum_bitwise_array_i/SolutionTest.kt index ebbe48dc3..82a12e76f 100644 --- a/src/test/kotlin/g3301_3400/s3314_construct_the_minimum_bitwise_array_i/SolutionTest.kt +++ b/src/test/kotlin/g3301_3400/s3314_construct_the_minimum_bitwise_array_i/SolutionTest.kt @@ -7,17 +7,17 @@ import org.junit.jupiter.api.Test internal class SolutionTest { @Test fun minBitwiseArray() { - assertThat( + assertThat( Solution().minBitwiseArray(mutableListOf(2, 3, 5, 7)), - equalTo(intArrayOf(-1, 1, 4, 3)), + equalTo(intArrayOf(-1, 1, 4, 3)), ) } @Test fun minBitwiseArray2() { - assertThat( + assertThat( Solution().minBitwiseArray(mutableListOf(11, 13, 31)), - equalTo(intArrayOf(9, 12, 15)), + equalTo(intArrayOf(9, 12, 15)), ) } } diff --git a/src/test/kotlin/g3301_3400/s3315_construct_the_minimum_bitwise_array_ii/SolutionTest.kt b/src/test/kotlin/g3301_3400/s3315_construct_the_minimum_bitwise_array_ii/SolutionTest.kt index c070800a9..5f146d717 100644 --- a/src/test/kotlin/g3301_3400/s3315_construct_the_minimum_bitwise_array_ii/SolutionTest.kt +++ b/src/test/kotlin/g3301_3400/s3315_construct_the_minimum_bitwise_array_ii/SolutionTest.kt @@ -7,17 +7,17 @@ import org.junit.jupiter.api.Test internal class SolutionTest { @Test fun minBitwiseArray() { - assertThat( + assertThat( Solution().minBitwiseArray(mutableListOf(2, 3, 5, 7)), - equalTo(intArrayOf(-1, 1, 4, 3)), + equalTo(intArrayOf(-1, 1, 4, 3)), ) } @Test fun minBitwiseArray2() { - assertThat( + assertThat( Solution().minBitwiseArray(mutableListOf(11, 13, 31)), - equalTo(intArrayOf(9, 12, 15)), + equalTo(intArrayOf(9, 12, 15)), ) } } diff --git a/src/test/kotlin/g3301_3400/s3316_find_maximum_removals_from_source_string/SolutionTest.kt b/src/test/kotlin/g3301_3400/s3316_find_maximum_removals_from_source_string/SolutionTest.kt index f6677858b..5efa77cb8 100644 --- a/src/test/kotlin/g3301_3400/s3316_find_maximum_removals_from_source_string/SolutionTest.kt +++ b/src/test/kotlin/g3301_3400/s3316_find_maximum_removals_from_source_string/SolutionTest.kt @@ -7,33 +7,33 @@ import org.junit.jupiter.api.Test internal class SolutionTest { @Test fun maxRemovals() { - assertThat( + assertThat( Solution().maxRemovals("abbaa", "aba", intArrayOf(0, 1, 2)), - equalTo(1), + equalTo(1), ) } @Test fun maxRemovals2() { - assertThat( + assertThat( Solution().maxRemovals("bcda", "d", intArrayOf(0, 3)), - equalTo(2), + equalTo(2), ) } @Test fun maxRemovals3() { - assertThat( + assertThat( Solution().maxRemovals("dda", "dda", intArrayOf(0, 1, 2)), - equalTo(0), + equalTo(0), ) } @Test fun maxRemovals4() { - assertThat( + assertThat( Solution().maxRemovals("yeyeykyded", "yeyyd", intArrayOf(0, 2, 3, 4)), - equalTo(2), + equalTo(2), ) } } diff --git a/src/test/kotlin/g3301_3400/s3317_find_the_number_of_possible_ways_for_an_event/SolutionTest.kt b/src/test/kotlin/g3301_3400/s3317_find_the_number_of_possible_ways_for_an_event/SolutionTest.kt index a2ce9dfd0..1ec0970cc 100644 --- a/src/test/kotlin/g3301_3400/s3317_find_the_number_of_possible_ways_for_an_event/SolutionTest.kt +++ b/src/test/kotlin/g3301_3400/s3317_find_the_number_of_possible_ways_for_an_event/SolutionTest.kt @@ -7,16 +7,16 @@ import org.junit.jupiter.api.Test internal class SolutionTest { @Test fun numberOfWays() { - assertThat(Solution().numberOfWays(1, 2, 3), equalTo(6)) + assertThat(Solution().numberOfWays(1, 2, 3), equalTo(6)) } @Test fun numberOfWays2() { - assertThat(Solution().numberOfWays(5, 2, 1), equalTo(32)) + assertThat(Solution().numberOfWays(5, 2, 1), equalTo(32)) } @Test fun numberOfWays3() { - assertThat(Solution().numberOfWays(3, 3, 4), equalTo(684)) + assertThat(Solution().numberOfWays(3, 3, 4), equalTo(684)) } } diff --git a/src/test/kotlin/g3301_3400/s3318_find_x_sum_of_all_k_long_subarrays_i/SolutionTest.kt b/src/test/kotlin/g3301_3400/s3318_find_x_sum_of_all_k_long_subarrays_i/SolutionTest.kt index 633883f6e..739682043 100644 --- a/src/test/kotlin/g3301_3400/s3318_find_x_sum_of_all_k_long_subarrays_i/SolutionTest.kt +++ b/src/test/kotlin/g3301_3400/s3318_find_x_sum_of_all_k_long_subarrays_i/SolutionTest.kt @@ -7,17 +7,17 @@ import org.junit.jupiter.api.Test internal class SolutionTest { @Test fun findXSum() { - assertThat( + assertThat( Solution().findXSum(intArrayOf(1, 1, 2, 2, 3, 4, 2, 3), 6, 2), - equalTo(intArrayOf(6, 10, 12)), + equalTo(intArrayOf(6, 10, 12)), ) } @Test fun findXSum2() { - assertThat( + assertThat( Solution().findXSum(intArrayOf(3, 8, 7, 8, 7, 5), 2, 2), - equalTo(intArrayOf(11, 15, 15, 15, 12)), + equalTo(intArrayOf(11, 15, 15, 15, 12)), ) } } diff --git a/src/test/kotlin/g3301_3400/s3319_k_th_largest_perfect_subtree_size_in_binary_tree/SolutionTest.kt b/src/test/kotlin/g3301_3400/s3319_k_th_largest_perfect_subtree_size_in_binary_tree/SolutionTest.kt index 5c62fd749..4e3046320 100644 --- a/src/test/kotlin/g3301_3400/s3319_k_th_largest_perfect_subtree_size_in_binary_tree/SolutionTest.kt +++ b/src/test/kotlin/g3301_3400/s3319_k_th_largest_perfect_subtree_size_in_binary_tree/SolutionTest.kt @@ -8,7 +8,7 @@ import org.junit.jupiter.api.Test internal class SolutionTest { @Test fun kthLargestPerfectSubtree() { - assertThat( + assertThat( Solution() .kthLargestPerfectSubtree( TreeNode.create( @@ -16,31 +16,31 @@ internal class SolutionTest { ), 2, ), - equalTo(3), + equalTo(3), ) } @Test fun kthLargestPerfectSubtree2() { - assertThat( + assertThat( Solution() .kthLargestPerfectSubtree( TreeNode.create(mutableListOf(1, 2, 3, 4, 5, 6, 7)), 1, ), - equalTo(7), + equalTo(7), ) } @Test fun kthLargestPerfectSubtree3() { - assertThat( + assertThat( Solution() .kthLargestPerfectSubtree( TreeNode.create(mutableListOf(1, 2, 3, null, 4)), 3, ), - equalTo(-1), + equalTo(-1), ) } } diff --git a/src/test/kotlin/g3301_3400/s3320_count_the_number_of_winning_sequences/SolutionTest.kt b/src/test/kotlin/g3301_3400/s3320_count_the_number_of_winning_sequences/SolutionTest.kt index ad2713ce5..302a6bcaa 100644 --- a/src/test/kotlin/g3301_3400/s3320_count_the_number_of_winning_sequences/SolutionTest.kt +++ b/src/test/kotlin/g3301_3400/s3320_count_the_number_of_winning_sequences/SolutionTest.kt @@ -7,11 +7,11 @@ import org.junit.jupiter.api.Test internal class SolutionTest { @Test fun countWinningSequences() { - assertThat(Solution().countWinningSequences("FFF"), equalTo(3)) + assertThat(Solution().countWinningSequences("FFF"), equalTo(3)) } @Test fun countWinningSequences2() { - assertThat(Solution().countWinningSequences("FWEFW"), equalTo(18)) + assertThat(Solution().countWinningSequences("FWEFW"), equalTo(18)) } } diff --git a/src/test/kotlin/g3301_3400/s3321_find_x_sum_of_all_k_long_subarrays_ii/SolutionTest.kt b/src/test/kotlin/g3301_3400/s3321_find_x_sum_of_all_k_long_subarrays_ii/SolutionTest.kt index 0e2c9d0d6..f738d3a49 100644 --- a/src/test/kotlin/g3301_3400/s3321_find_x_sum_of_all_k_long_subarrays_ii/SolutionTest.kt +++ b/src/test/kotlin/g3301_3400/s3321_find_x_sum_of_all_k_long_subarrays_ii/SolutionTest.kt @@ -7,17 +7,17 @@ import org.junit.jupiter.api.Test internal class SolutionTest { @Test fun findXSum() { - assertThat( + assertThat( Solution().findXSum(intArrayOf(1, 1, 2, 2, 3, 4, 2, 3), 6, 2), - equalTo(longArrayOf(6L, 10L, 12L)), + equalTo(longArrayOf(6L, 10L, 12L)), ) } @Test fun findXSum2() { - assertThat( + assertThat( Solution().findXSum(intArrayOf(3, 8, 7, 8, 7, 5), 2, 2), - equalTo(longArrayOf(11L, 15L, 15L, 15L, 12L)), + equalTo(longArrayOf(11L, 15L, 15L, 15L, 12L)), ) } } diff --git a/src/test/kotlin/g3301_3400/s3330_find_the_original_typed_string_i/SolutionTest.kt b/src/test/kotlin/g3301_3400/s3330_find_the_original_typed_string_i/SolutionTest.kt index 854d84248..45ed5bfe8 100644 --- a/src/test/kotlin/g3301_3400/s3330_find_the_original_typed_string_i/SolutionTest.kt +++ b/src/test/kotlin/g3301_3400/s3330_find_the_original_typed_string_i/SolutionTest.kt @@ -7,16 +7,16 @@ import org.junit.jupiter.api.Test internal class SolutionTest { @Test fun possibleStringCount() { - assertThat(Solution().possibleStringCount("abbcccc"), equalTo(5)) + assertThat(Solution().possibleStringCount("abbcccc"), equalTo(5)) } @Test fun possibleStringCount2() { - assertThat(Solution().possibleStringCount("abcd"), equalTo(1)) + assertThat(Solution().possibleStringCount("abcd"), equalTo(1)) } @Test fun possibleStringCount3() { - assertThat(Solution().possibleStringCount("aaaa"), equalTo(4)) + assertThat(Solution().possibleStringCount("aaaa"), equalTo(4)) } } diff --git a/src/test/kotlin/g3301_3400/s3331_find_subtree_sizes_after_changes/SolutionTest.kt b/src/test/kotlin/g3301_3400/s3331_find_subtree_sizes_after_changes/SolutionTest.kt index abc2c79a7..2abde715e 100644 --- a/src/test/kotlin/g3301_3400/s3331_find_subtree_sizes_after_changes/SolutionTest.kt +++ b/src/test/kotlin/g3301_3400/s3331_find_subtree_sizes_after_changes/SolutionTest.kt @@ -7,17 +7,17 @@ import org.junit.jupiter.api.Test internal class SolutionTest { @Test fun findSubtreeSizes() { - assertThat( + assertThat( Solution().findSubtreeSizes(intArrayOf(-1, 0, 0, 1, 1, 1), "abaabc"), - equalTo(intArrayOf(6, 3, 1, 1, 1, 1)), + equalTo(intArrayOf(6, 3, 1, 1, 1, 1)), ) } @Test fun findSubtreeSizes2() { - assertThat( + assertThat( Solution().findSubtreeSizes(intArrayOf(-1, 0, 4, 0, 1), "abbba"), - equalTo(intArrayOf(5, 2, 1, 1, 1)), + equalTo(intArrayOf(5, 2, 1, 1, 1)), ) } } diff --git a/src/test/kotlin/g3301_3400/s3333_find_the_original_typed_string_ii/SolutionTest.kt b/src/test/kotlin/g3301_3400/s3333_find_the_original_typed_string_ii/SolutionTest.kt index 1d8ba296e..c14f69ca2 100644 --- a/src/test/kotlin/g3301_3400/s3333_find_the_original_typed_string_ii/SolutionTest.kt +++ b/src/test/kotlin/g3301_3400/s3333_find_the_original_typed_string_ii/SolutionTest.kt @@ -7,16 +7,16 @@ import org.junit.jupiter.api.Test internal class SolutionTest { @Test fun possibleStringCount() { - assertThat(Solution().possibleStringCount("aabbccdd", 7), equalTo(5)) + assertThat(Solution().possibleStringCount("aabbccdd", 7), equalTo(5)) } @Test fun possibleStringCount2() { - assertThat(Solution().possibleStringCount("aabbccdd", 8), equalTo(1)) + assertThat(Solution().possibleStringCount("aabbccdd", 8), equalTo(1)) } @Test fun possibleStringCount3() { - assertThat(Solution().possibleStringCount("aaabbb", 3), equalTo(8)) + assertThat(Solution().possibleStringCount("aaabbb", 3), equalTo(8)) } } diff --git a/src/test/kotlin/g3301_3400/s3334_find_the_maximum_factor_score_of_array/SolutionTest.kt b/src/test/kotlin/g3301_3400/s3334_find_the_maximum_factor_score_of_array/SolutionTest.kt index c7f7b17be..8193899a2 100644 --- a/src/test/kotlin/g3301_3400/s3334_find_the_maximum_factor_score_of_array/SolutionTest.kt +++ b/src/test/kotlin/g3301_3400/s3334_find_the_maximum_factor_score_of_array/SolutionTest.kt @@ -7,19 +7,19 @@ import org.junit.jupiter.api.Test internal class SolutionTest { @Test fun maxScore() { - assertThat(Solution().maxScore(intArrayOf(2, 4, 8, 16)), equalTo(64L)) + assertThat(Solution().maxScore(intArrayOf(2, 4, 8, 16)), equalTo(64L)) } @Test fun maxScore2() { - assertThat( + assertThat( Solution().maxScore(intArrayOf(1, 2, 3, 4, 5)), - equalTo(60L), + equalTo(60L), ) } @Test fun maxScore3() { - assertThat(Solution().maxScore(intArrayOf(3)), equalTo(9L)) + assertThat(Solution().maxScore(intArrayOf(3)), equalTo(9L)) } } diff --git a/src/test/kotlin/g3301_3400/s3335_total_characters_in_string_after_transformations_i/SolutionTest.kt b/src/test/kotlin/g3301_3400/s3335_total_characters_in_string_after_transformations_i/SolutionTest.kt index 05b13ffb3..d88f59b0a 100644 --- a/src/test/kotlin/g3301_3400/s3335_total_characters_in_string_after_transformations_i/SolutionTest.kt +++ b/src/test/kotlin/g3301_3400/s3335_total_characters_in_string_after_transformations_i/SolutionTest.kt @@ -7,11 +7,11 @@ import org.junit.jupiter.api.Test internal class SolutionTest { @Test fun lengthAfterTransformations() { - assertThat(Solution().lengthAfterTransformations("abcyy", 2), equalTo(7)) + assertThat(Solution().lengthAfterTransformations("abcyy", 2), equalTo(7)) } @Test fun lengthAfterTransformations2() { - assertThat(Solution().lengthAfterTransformations("azbk", 1), equalTo(5)) + assertThat(Solution().lengthAfterTransformations("azbk", 1), equalTo(5)) } } diff --git a/src/test/kotlin/g3301_3400/s3336_find_the_number_of_subsequences_with_equal_gcd/SolutionTest.kt b/src/test/kotlin/g3301_3400/s3336_find_the_number_of_subsequences_with_equal_gcd/SolutionTest.kt index a56b337cd..db93dba6d 100644 --- a/src/test/kotlin/g3301_3400/s3336_find_the_number_of_subsequences_with_equal_gcd/SolutionTest.kt +++ b/src/test/kotlin/g3301_3400/s3336_find_the_number_of_subsequences_with_equal_gcd/SolutionTest.kt @@ -7,17 +7,17 @@ import org.junit.jupiter.api.Test internal class SolutionTest { @Test fun subsequencePairCount() { - assertThat( + assertThat( Solution().subsequencePairCount(intArrayOf(1, 2, 3, 4)), - equalTo(10), + equalTo(10), ) } @Test fun subsequencePairCount2() { - assertThat( + assertThat( Solution().subsequencePairCount(intArrayOf(10, 20, 30)), - equalTo(2), + equalTo(2), ) } } diff --git a/src/test/kotlin/g3301_3400/s3340_check_balanced_string/SolutionTest.kt b/src/test/kotlin/g3301_3400/s3340_check_balanced_string/SolutionTest.kt index 6c229df1b..cadbc64ef 100644 --- a/src/test/kotlin/g3301_3400/s3340_check_balanced_string/SolutionTest.kt +++ b/src/test/kotlin/g3301_3400/s3340_check_balanced_string/SolutionTest.kt @@ -7,11 +7,11 @@ import org.junit.jupiter.api.Test internal class SolutionTest { @Test fun isBalanced() { - assertThat(Solution().isBalanced("1234"), equalTo(false)) + assertThat(Solution().isBalanced("1234"), equalTo(false)) } @Test fun isBalanced2() { - assertThat(Solution().isBalanced("24123"), equalTo(true)) + assertThat(Solution().isBalanced("24123"), equalTo(true)) } } diff --git a/src/test/kotlin/g3301_3400/s3341_find_minimum_time_to_reach_last_room_i/SolutionTest.kt b/src/test/kotlin/g3301_3400/s3341_find_minimum_time_to_reach_last_room_i/SolutionTest.kt index 0ac218a1d..bf29510e2 100644 --- a/src/test/kotlin/g3301_3400/s3341_find_minimum_time_to_reach_last_room_i/SolutionTest.kt +++ b/src/test/kotlin/g3301_3400/s3341_find_minimum_time_to_reach_last_room_i/SolutionTest.kt @@ -7,40 +7,40 @@ import org.junit.jupiter.api.Test internal class SolutionTest { @Test fun minTimeToReach() { - assertThat( + assertThat( Solution().minTimeToReach( arrayOf( intArrayOf(0, 4), intArrayOf(4, 4), ), ), - equalTo(6), + equalTo(6), ) } @Test fun minTimeToReach2() { - assertThat( + assertThat( Solution().minTimeToReach( arrayOf( intArrayOf(0, 0, 0), intArrayOf(0, 0, 0), ), ), - equalTo(3), + equalTo(3), ) } @Test fun minTimeToReach3() { - assertThat( + assertThat( Solution().minTimeToReach( arrayOf( intArrayOf(0, 1), intArrayOf(1, 2), ), ), - equalTo(3), + equalTo(3), ) } } diff --git a/src/test/kotlin/g3301_3400/s3342_find_minimum_time_to_reach_last_room_ii/SolutionTest.kt b/src/test/kotlin/g3301_3400/s3342_find_minimum_time_to_reach_last_room_ii/SolutionTest.kt index 74cee9752..6c8e1d82a 100644 --- a/src/test/kotlin/g3301_3400/s3342_find_minimum_time_to_reach_last_room_ii/SolutionTest.kt +++ b/src/test/kotlin/g3301_3400/s3342_find_minimum_time_to_reach_last_room_ii/SolutionTest.kt @@ -7,35 +7,35 @@ import org.junit.jupiter.api.Test internal class SolutionTest { @Test fun minTimeToReach() { - assertThat( + assertThat( Solution().minTimeToReach( arrayOf( intArrayOf(0, 4), intArrayOf(4, 4), ), ), - equalTo(7), + equalTo(7), ) } @Test fun minTimeToReach2() { - assertThat( + assertThat( Solution().minTimeToReach(arrayOf(intArrayOf(0, 0, 0, 0), intArrayOf(0, 0, 0, 0))), - equalTo(6), + equalTo(6), ) } @Test fun minTimeToReach3() { - assertThat( + assertThat( Solution().minTimeToReach( arrayOf( intArrayOf(0, 1), intArrayOf(1, 2), ), ), - equalTo(4), + equalTo(4), ) } } diff --git a/src/test/kotlin/g3301_3400/s3343_count_number_of_balanced_permutations/SolutionTest.kt b/src/test/kotlin/g3301_3400/s3343_count_number_of_balanced_permutations/SolutionTest.kt index 841ee524c..51fe5859f 100644 --- a/src/test/kotlin/g3301_3400/s3343_count_number_of_balanced_permutations/SolutionTest.kt +++ b/src/test/kotlin/g3301_3400/s3343_count_number_of_balanced_permutations/SolutionTest.kt @@ -7,16 +7,16 @@ import org.junit.jupiter.api.Test internal class SolutionTest { @Test fun countBalancedPermutations() { - assertThat(Solution().countBalancedPermutations("123"), equalTo(2)) + assertThat(Solution().countBalancedPermutations("123"), equalTo(2)) } @Test fun countBalancedPermutations2() { - assertThat(Solution().countBalancedPermutations("112"), equalTo(1)) + assertThat(Solution().countBalancedPermutations("112"), equalTo(1)) } @Test fun countBalancedPermutations3() { - assertThat(Solution().countBalancedPermutations("12345"), equalTo(0)) + assertThat(Solution().countBalancedPermutations("12345"), equalTo(0)) } }