-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsmallest_subarray.h
More file actions
30 lines (26 loc) · 1.06 KB
/
smallest_subarray.h
File metadata and controls
30 lines (26 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#ifndef CPP_ALGORITHM_SMALLEST_SUBARRAY_H
#define CPP_ALGORITHM_SMALLEST_SUBARRAY_H
#include <string>
#include <vector>
namespace SmallestSubarray
{
/**
* \brief Find the smallest subarray that covers all the elements in a set.
* \param paragraph an array
* \param keywords a set
* \return a tuple of the start and end indices of the smallest subarray
*/
auto FindSmallestSubarrayCoveringSubset(const std::vector<std::string>& paragraph,
const std::vector<std::string>& keywords)
-> std::tuple<int, int>;
/**
* \brief Find the smallest subarray that sequentially covers all the elements in a set.
* \param paragraph an array
* \param keywords a set
* \return a tuple of the start and end indices of the smallest subarray
*/
auto FindSmallestSubarraySequentiallyCoveringSubset(const std::vector<std::string>& paragraph,
const std::vector<std::string>& keywords)
-> std::tuple<int, int>;
}
#endif