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

LeetCode 540. Single Element in a Sorted Array 更多...

class  Solution
 

函数

 TEST (single_element_in_a_sorted_array, case1)
 
 TEST (single_element_in_a_sorted_array, case2)
 

详细描述

LeetCode 540. Single Element in a Sorted Array

函数说明

◆ TEST() [1/2]

leetcode::single_element_in_a_sorted_array::TEST ( single_element_in_a_sorted_array  ,
case1   
)

在文件 leetcode_test.cpp1520 行定义.

1520 {
1521 vector input = {1, 1, 2, 3, 3, 4, 4, 8, 8};
1522 ASSERT_EQ(2, Solution::singleNonDuplicate(input));
1523 }

引用了 leetcode::single_element_in_a_sorted_array::Solution::singleNonDuplicate().

◆ TEST() [2/2]

leetcode::single_element_in_a_sorted_array::TEST ( single_element_in_a_sorted_array  ,
case2   
)

在文件 leetcode_test.cpp1525 行定义.

1525 {
1526 vector input = {3, 3, 7, 7, 10, 11, 11};
1527 ASSERT_EQ(10, Solution::singleNonDuplicate(input));
1528 }

引用了 leetcode::single_element_in_a_sorted_array::Solution::singleNonDuplicate().