Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create LARGESTK.cpp #1268

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

RohithaAiswarya16
Copy link

Added a new program LARGESTK.cpp that computes the largest possible value based on the frequency distribution of array elements. The solution calculates the maximum achievable sum by analyzing the frequencies of each unique element in the input array and applying frequency-based calculations.

This code includes the following features:

  • Uses an unordered map to count element frequencies.
  • Sorts the frequency counts to find the maximum value with an iterative method.
  • Example inputs and explanations are included to illustrate the functionality and expected output.
Closing Issue/Referencing Issue

issue reference (#)

Changes Made In Pull Request

added solution to a codechef problem
Largest K
You are given an array A of size N. Find the largest integer K such that there exists a [subsequence (https://en.wikipedia.org/wiki/Subsequence) S of length K where K is divisible by the number of distinct elements in S.
*
*

Added a new program LARGESTK.cpp that computes the largest possible value based on the frequency distribution of array elements. The solution calculates the maximum achievable sum by analyzing the frequencies of each unique element in the input array and applying frequency-based calculations.

This code includes the following features:
- Uses an unordered map to count element frequencies.
- Sorts the frequency counts to find the maximum value with an iterative method.
- Example inputs and explanations are included to illustrate the functionality and expected output.
Copy link

welcome bot commented Oct 31, 2024

I can tell this is your first pull request! Thank you I'm so honored. 🎉🎉🎉
I'll take a look at it ASAP!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant