Hello Everyone!!!
It is time to face some interesting problems.
Are you excited😄😄😄😄
Our 1st problem is from codechef
PROBLEM LINK:
ONE KING
DIFFICULTY:
EASY-MEDIUM
PROBLEM:
Given N (≤100000) intervals [Ai , Bi], one such interval can be deleted by placing a bomb at x if Ai ≤ x ≤ Bi. Find minimum number of bombs required to delete all intervals.
SOLUTION:
EXPLANATION
CODE:
code
NOTE: Above idea is implemented using C++. Some C++ template classes from STL(Standard Template Library) are used. (STL). Specifically vector and pair are used in the solution code.
vector
pair
sorting vector of pairs
#oneking #codechef
It is time to face some interesting problems.
Are you excited😄😄😄😄
Our 1st problem is from codechef
PROBLEM LINK:
ONE KING
DIFFICULTY:
EASY-MEDIUM
PROBLEM:
Given N (≤100000) intervals [Ai , Bi], one such interval can be deleted by placing a bomb at x if Ai ≤ x ≤ Bi. Find minimum number of bombs required to delete all intervals.
SOLUTION:
EXPLANATION
CODE:
code
NOTE: Above idea is implemented using C++. Some C++ template classes from STL(Standard Template Library) are used. (STL). Specifically vector and pair are used in the solution code.
vector
pair
sorting vector of pairs
#oneking #codechef
Codechef
One Dimensional Kingdoms Practice Coding Problem
Improve your coding skills with our One Dimensional Kingdoms practice problem! Challenge yourself and solve One Dimensional Kingdoms practical programming coding exercises.