chocolate_distribution_problem

package
v0.0.0-...-d7cbdf0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 20, 2023 License: CC0-1.0, CC-BY-SA-4.0 Imports: 1 Imported by: 0

README

Chocolate distribution problem

Given an array of N integers where each value represents the number of chocolates in a packet. Each packet can have a variable number of chocolates. There are m students, the task is to distribute chocolate packets such that:

  • Each student gets one packet.
  • The difference between the number of chocolates in the packet with maximum chocolates and the packet with minimum chocolates given to the students is minimum.

This problem is based on content from GeeksforGeeks written by GeeksforGeeks and subject to GeeksforGeeks copyright. The original content from GeeksforGeeks and any modifications made here are attributed to GeeksforGeeks contributors, and this work is shared under CC BY-SA 4.0.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Solution

func Solution(arr []int, m int) (mindiff int)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL