Skip to content
Programming101
Programming101

Learn everything about programming

  • Home
  • CS Subjects
    • IoT – Internet of Things
    • Digital Communication
    • Human Values
  • Programming Tutorials
    • C Programming
    • Data structures and Algorithms
  • HackerRank Solutions
    • HackerRank Algorithms Solutions
    • HackerRank C problems solutions
    • HackerRank C++ problems solutions
    • HackerRank Java problems solutions
    • HackerRank Python problems solutions
Programming101
Programming101

Learn everything about programming

HackerEarth Aldrin Justice problem solution

YASH PAL, 31 July 2024
In this HackerEarth Aldrin Justice problem solution Lily Aldrin, as the slap bet commissioner, needs to resolve issues regarding slap bets due with Barney and Marshall. She has mandated that there be a fixed period of time in which the slaps may be used.
So, she draws two lines representing the given two-time slots, each of Barney and Marshall; you need to help her write a program that:
Outputs “Nothing” if given lines are indistinguishable.
Outputs “Line” if there exists a timeline(more than one day) in which none of them have the opportunity to slap.
Outputs “Point” if the intersection of lines is just in one point.
HackerEarth Aldrin Justice problem solution

HackerEarth Aldrin Justice problem solution.

#include <bits/stdc++.h>

using namespace std;

int main ()
{
int tc;
cin >> tc;
while (tc--)
{
int a, b, c, d;
cin >> a >> b >> c >> d;

int lef = min(max(a, b), max(c, d));
int righ = max(min(a, b), min(c, d));

if (lef>righ)
{
cout << "Nothing" << endl;
}

else
{
if (lef==righ)
{
cout << "Point" << endl;
}
else
{
cout << "Line" << endl;
}
}
}
return 0;
}
coding problems

Post navigation

Previous post
Next post
  • How AI Is Revolutionizing Personalized Learning in Schools
  • GTA 5 is the Game of the Year for 2024 and 2025
  • Hackerrank Day 5 loops 30 days of code solution
  • Hackerrank Day 6 Lets Review 30 days of code solution
  • Hackerrank Day 14 scope 30 days of code solution
©2025 Programming101 | WordPress Theme by SuperbThemes