Skip to main content

Posts

Featured

Product distribution problem

PRODUCT DISTRIBUTION PROBLEM Hello people so today we are with the product distribution problem the answer is not correct as it dosent satisfies a lot of test cases in hacker rank but would love to share my answer A company has requested to streamline their product allocation strategy, and given    products, each of which has an associated value, you are required to arrange these products into segments for processing. There are infinite segments indexed as 1, 2, 3 and so on. However, there are two constraints: You can assign a product to a segment with index   if and only if   or the segment with index   has at least   products. Any segment must contain either no products or at least   products. The score for a segment is defined as the index of the segment multiplied by the sum of values of the products it contains. The score of an arrangement of products is the sum of scores of segments. Your task is to c...

Latest Posts

List Functions

List in python