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
|
37 Discussions
|
Please Login in order to post a comment
Had to use chatGPT to translate the problem description into a more readable format. What kind of robots are writing these problems?
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