We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Interval Selection
Interval Selection
Sort by
recency
|
36 Discussions
|
Please Login in order to post a comment
include
include
include
using namespace std;
struct Activity { int start; int finish; int index; // Original index of the activity };
bool compare(Activity a, Activity b) { return a.finish < b.finish; }
void maxActivities(vector& activities) { int n = activities.size(); // Sort activities based on finish time sort(activities.begin(), activities.end(), compare);
}
int main() { int n; cin >> n;
}****
My typescript solution:
Here is my solution in java, javascript, python, C, C++, Csharp HackerRank Interval Selection Problem Solution
Here is Interval Selection problem solution - https://programs.programmingoneonone.com/2021/07/hackerrank-interval-selection-problem-solution.html
I understand the question after a good 15 minutes of reading. Not Google interview worthy problem solving skills yet, but I'm proud of myself for getting this far.