Skip to content
Programmingoneonone
Programmingoneonone
  • Engineering Subjects
    • Internet of Things (IoT)
    • Digital Communication
    • Human Values
  • Programming Tutorials
    • C Programming
    • Data structures and Algorithms
    • 100+ Java Programs
    • 100+ C Programs
    • 100+ C++ Programs
  • Solutions
    • HackerRank
      • Algorithms Solutions
      • C solutions
      • C++ solutions
      • Java solutions
      • Python solutions
    • Leetcode Solutions
    • HackerEarth Solutions
  • Work with US
Programmingoneonone
Programmingoneonone

HackerEarth Little Jhool and his breakup problem solution

YASH PAL, 31 July 202413 February 2026
In this HackerEarth Little Jhool and his breakup problem solution After minting loads of money from innocent people by using the psychic powers (As we saw in the previous question!) – little Jhool managed to woo his girlfriend big Jhool! And now, he’s in love – madly, madly in love with his girlfriend.
 
But the road to love is not easy as they say, little Jhool and big Jhool live in two different cities, and they often have to rely on multiple online clients to communicate. And many times, due to frustration, little Jhool starts hitting his keyboard, pressing the wrong keys – and thus, he ends up sending her a meaningless message, which frustrates his girlfriend – obviously. But big Jhool is a smart girl and she knows what to reciprocate back to her boyfriend’s message based on the message she has received from him.
 
She figures that if and only if, she can delete several characters from the message sent by her boyfriend, resulting in the word “love”, it will be considered that she managed to understand his message, and if not… well, some trouble is waiting for her boyfriend!
 
 
HackerEarth Little Jhool and his breakup problem solution

 

 

HackerEarth Little Jhool and his breakup problem solution.

import re
message = raw_input()
if re.search("l.*o.*v.*e", message):
print "I love you, too!"
else:
print "Let us breakup!"
 

Second solution

#include <stdio.h>

int main(void)
{
char ch[150], love[] = "love";
int len, j = 0;
int arr[4] = {0};
// Trick to find length of the input string
scanf("%s%n", ch, &len);
for(register int i = 0 ; i < len ; ++i)
{
if( arr[j] == 0 && ch[i] == love[j])
arr[j++] = 1;
}
if (j == 4)
puts("I love you, too!");
else
puts("Let us breakup!");
return 0;
}
 
coding problems solutions HackerEarth HackerEarth

Post navigation

Previous post
Next post

Leave a Reply

Your email address will not be published. Required fields are marked *

Programmingoneonone

We at Programmingoneonone, also known as Programming101 is a learning hub of programming and other related stuff. We provide free learning tutorials/articles related to programming and other technical stuff to people who are eager to learn about it.

Pages

  • About US
  • Contact US
  • Privacy Policy

Practice

  • Java
  • C++
  • C

Follow US

  • YouTube
  • LinkedIn
  • Facebook
  • Pinterest
  • Instagram
©2026 Programmingoneonone | WordPress Theme by SuperbThemes