Skip to content

Create LARGESTK.cpp#1268

Open
RohithaAiswarya16 wants to merge 1 commit intoows-ali:masterfrom
RohithaAiswarya16:patch-1
Open

Create LARGESTK.cpp#1268
RohithaAiswarya16 wants to merge 1 commit intoows-ali:masterfrom
RohithaAiswarya16:patch-1

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.
@welcome
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