Hacktoberfest icon indicating copy to clipboard operation
Hacktoberfest copied to clipboard

Create LARGESTK.cpp

Open RohithaAiswarya16 opened this issue 1 year ago • 1 comments

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. * *

RohithaAiswarya16 avatar Oct 31 '24 16:10 RohithaAiswarya16

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

welcome[bot] avatar Oct 31 '24 16:10 welcome[bot]