Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class BestTravel
- {
- public:
- static int chooseBestSum(int t, int k, std::vector<int>& ls){
- std::cout << "size: " << ls.size() << '\n';
- int combinations = factorial(ls.size())/(factorial(ls.size()-k)*factorial(k));
- std::cout << "combinations: " << combinations << '\n';
- int sum[combinations];
- int return_value;
- return return_value;
- };
- static int factorial(int n)
- {
- // single line to find factorial
- return (n==1 || n==0) ? 1: n * factorial(n - 1);
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement