problemscpp
A collection of my answers to algorithm problems in c++.
| 函数
leetcode::number_of_lines_to_write_string 命名空间参考

  1. Number of Lines To Write String
更多...

class  Solution
 

函数

 TEST (number_of_lines_to_write_string, case1)
 
 TEST (number_of_lines_to_write_string, case2)
 

详细描述

  1. Number of Lines To Write String

函数说明

◆ TEST() [1/2]

leetcode::number_of_lines_to_write_string::TEST ( number_of_lines_to_write_string  ,
case1   
)

在文件 leetcode_test.cpp2816 行定义.

2816 {
2817 vector width = {10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10};
2818 const vector output = {3, 60};
2819 ASSERT_EQ(output, Solution::numberOfLines(width, "abcdefghijklmnopqrstuvwxyz"));
2820 }

引用了 leetcode::number_of_lines_to_write_string::Solution::numberOfLines().

◆ TEST() [2/2]

leetcode::number_of_lines_to_write_string::TEST ( number_of_lines_to_write_string  ,
case2   
)

在文件 leetcode_test.cpp2822 行定义.

2822 {
2823 vector width = {4, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10};
2824 const vector output = {2, 4};
2825 ASSERT_EQ(output, Solution::numberOfLines(width, "bbbcccdddaaa"));
2826 }

引用了 leetcode::number_of_lines_to_write_string::Solution::numberOfLines().