46 Container kMarketPrices(RandomArrayInt, RandomArrayInt +
sizeof(RandomArrayInt) /
sizeof(
int));
47 const auto kMaxBeneficeIndexes = MaxSubSequence<IT>(kMarketPrices.begin(), kMarketPrices.end());
48 EXPECT_EQ(5, kMaxBeneficeIndexes.first);
49 EXPECT_EQ(9, kMaxBeneficeIndexes.second);
54 Container kSortedArray(SortedArrayInt, SortedArrayInt +
sizeof(SortedArrayInt) /
sizeof(
int));
55 const auto kIndexes = MaxSubSequence<IT>(kSortedArray.begin(), kSortedArray.end());
56 EXPECT_EQ(2, kIndexes.first);
57 EXPECT_EQ(static_cast<int>(kSortedArray.size()) - 1, kIndexes.second);
62 Container insufficientArray = Container(1, 2);
63 const auto kIndexes = MaxSubSequence<IT>(insufficientArray.begin(), insufficientArray.end());
64 EXPECT_EQ(-1, kIndexes.first);
65 EXPECT_EQ(-1, kIndexes.second);
70 Container twoElementArray = Container(2, 2);
71 const auto kIndexes = MaxSubSequence<IT>(twoElementArray.begin(), twoElementArray.end());
72 EXPECT_EQ(0, kIndexes.first);
73 EXPECT_EQ(1, kIndexes.second);
79 Container sameElementArray = Container(kSize, 2);
80 const auto indexes = MaxSubSequence<IT>(sameElementArray.begin(), sameElementArray.end());
81 EXPECT_EQ(0, indexes.first);
82 EXPECT_EQ(kSize - 1, indexes.second);