This repository includes some challenging algorithms that I developed as a part of Algorithmic Toolbox module on Coursera.
Problem description:
-
largest_numberCW.cpp task: Compose the largest number out of a set of integers. input: The first line of the input contains an integer n. The second line contains a set of integers out: Output the largest number that can be composed out of these integers challenge: the task is easy whem the integers are only single digits. this algorithm can handle multi-digit integers too.
-
different_summandsCW.cpp: task: represent a given positive integer n as a sum of as many pairwise distinct positive integers as possible. That is, to find the maximum k such that n can be written as a1 + a2 + ··· + ak where a1 ,..., ak are positive integers and a i ̸= a j for all 1 ≤ i < j ≤ k. input: integer n out: In the first line, output the maximum number k such that n can be represented as a sum of k pairwise distinct positive integers. In the second line, output k pairwise distinct positive integers that sum up to n (if there are many such representations, output any of them).