Lakhankumawat / LearnCPP

Learn Cpp from Beginner to Advanced ✅ Practice 🎯 Code 💻 Repeat 🔁 One step solution for c++ beginners and cp enthusiasts.
https://lakhankumawat.github.io/LearnCPP/
MIT License
598 stars 484 forks source link

Sum of first K natural numbers missing in an Array using Set #1556

Closed psorat307 closed 2 years ago

psorat307 commented 2 years ago

Description

Given an array arr[ ] of size N and a number K, the task is to find the sum of the first K natural numbers that are not present in the given array.

Example:

Input: arr[] = {2, 3, 4}, K = 3 Output: 12 Explanation: First 3 Missing numbers are: [1, 5, 6]

Domain

CPP

Type of Contribution

Addition

Code of Conduct

github-actions[bot] commented 2 years ago

Hello @psorat307, thanks for creating your first issue at LearnCPP, hope you followed the guidelines.

psorat307 commented 2 years ago

/assign

github-actions[bot] commented 2 years ago

This issue has been assigned to psorat307! It will become unassigned if it is not closed within 12 days. A maintainer can also add the pinned label to prevent it from being unassigned.

psorat307 commented 2 years ago

@Lakhankumawat Please review it

github-actions[bot] commented 2 years ago

This issue is stale because it has been open 3 days with no activity. Remove stale label or comment or this will be closed in 2 days.

github-actions[bot] commented 2 years ago

This issue was closed because it has been stalled for 5 days with no activity. Please reopen this issue if not resolved.