problemscpp
A collection of my answers to algorithm problems in c++.
载入中...
搜索中...
未找到
leetcode::divide_a_string_into_groups_of_size_k 命名空间参考

LeetCode 5980. 将字符串拆分为若干长度为 k 的组 更多...

class  Solution
 

函数

 TEST (divide_a_string_into_groups_of_size_k, case1)
 
 TEST (divide_a_string_into_groups_of_size_k, case2)
 
 TEST (divide_a_string_into_groups_of_size_k, case3)
 

详细描述

LeetCode 5980. 将字符串拆分为若干长度为 k 的组

函数说明

◆ TEST() [1/3]

leetcode::divide_a_string_into_groups_of_size_k::TEST ( divide_a_string_into_groups_of_size_k ,
case1  )

在文件 leetcode_test.cpp653 行定义.

653 {
654 string output[] = {"abc", "def", "ghi"};
655 const auto vec = vector(begin(output), end(output));
656 ASSERT_EQ(vec, Solution::divideString("abcdefghi", 3, 'x'));
657 }
static vector< string > divideString(const string &s, int k, char fill)

引用了 leetcode::divide_a_string_into_groups_of_size_k::Solution::divideString().

◆ TEST() [2/3]

leetcode::divide_a_string_into_groups_of_size_k::TEST ( divide_a_string_into_groups_of_size_k ,
case2  )

在文件 leetcode_test.cpp659 行定义.

659 {
660 string output[] = {"abc", "def", "ghi", "jxx"};
661 const auto vec = vector(begin(output), end(output));
662 ASSERT_EQ(vec, Solution::divideString("abcdefghij", 3, 'x'));
663 }

引用了 leetcode::divide_a_string_into_groups_of_size_k::Solution::divideString().

◆ TEST() [3/3]

leetcode::divide_a_string_into_groups_of_size_k::TEST ( divide_a_string_into_groups_of_size_k ,
case3  )

在文件 leetcode_test.cpp665 行定义.

665 {
666 string output[] = {"ctoyjrwt", "ngqwtnnn"};
667 const auto vec = vector(begin(output), end(output));
668 ASSERT_EQ(vec, Solution::divideString("ctoyjrwtngqwt", 8, 'n'));
669 }

引用了 leetcode::divide_a_string_into_groups_of_size_k::Solution::divideString().