WebClub-NITK / Hacktoberfest-2k21

Repository for Hacktoberfest-2k21

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Get the next largest number.

sravanireddy1102 opened this issue · comments

Description:

Given a number n, find the smallest number that has same set of digits as n and is greater than n. If x is the greatest possible number with its set of digits, then print “not possible”.
ex:
Input: n = "1234"
Output: "1243"

Input: n = "4321"
Output: "Not Possible"

Details

Technical Specification: Solution to the code in C, C++, Python, JavaScript is accepted.
Type of Issue: Single
Time Limit: 1 day (from the moment the issue has been assigned to someone)

Directory Structure

Create a folder named "Greater-number" in the Algorithms folder and submit the code file.

Note
Please claim the issue first by commenting here before starting to work on it.
Once you are done with the task and have created a Pull Request, please tag @sravanireddy1102 to request a review.

@ikjot-2605 Please assign it to me. I would like to work on it.

@ikjot-2605 Please assign this issue to @khannakshat7. Thank you.

@sravanireddy1102 Please review and merge the PR.

@ikjot-2605 Please add Hacktoberfest topic in your repo.

image