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
      • Data Structures Solutions
    • Leetcode Solutions
    • HackerEarth Solutions
  • Work with US
Programmingoneonone
Programmingoneonone

HackerEarth Furniture Transportation problem solution

YASH PAL, 31 July 202413 February 2026
In this HackerEarth Furniture Transportation problem solution, The warehouse of the Urban ladder in Bangalore has n packages containing furniture. As the warehouse cannot accommodate all of them, the warehouse manager has decided to transfer m of the packages to a warehouse located in Chennai.
 
For this reason, all the packages are kept in a line and a number(which determines its value) is written on them. The number is calculated based on the price of the furniture in the package. The greater the number, the more valuable the package is.
 
Then, the warehouse manager asks you to choose the m packages, which will be transferred to the other warehouse. He also imposed two conditions. They are,
  1. The chosen m packages have to form a contiguous segment of packages.
  2. Any of the chosen package’s value should not be greater than a number l as the manager doesn’t want to take the risk of damage to the furniture.
Find the number of ways you can choose the m packages.
 
 
HackerEarth Furniture Transportation problem solution

 

 

HackerEarth Furniture Transportation problem solution.

n,l,m = map(int,input().split())
A = [int(x) for x in input().split()]
count2 = 0
for i in range(n-m+1):
B = A[i:i+m]
count = 0
for j in B:
if j<=l:
count+=1
if count == len(B):
count2+=1
print(count2)
 
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