Question: SOLVE THE FOLLOWING QUESTION IN HASKELL WITHOUT USING PRELUDE FUNCTIONS OR IMPORTING ANY LIBRARIES. You may make as many helper functions as needed. Create a
SOLVE THE FOLLOWING QUESTION IN HASKELL WITHOUT USING PRELUDE FUNCTIONS OR IMPORTING ANY LIBRARIES. You may make as many helper functions as needed.
Create a function that takes a positive integer and returns the next bigger number that can be formed by rearranging its digits. If the digits can't be rearranged to form a bigger number, return -1.
For example,
Input: 513
Output: 531
The following test cases must be passed:

Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
