2017-03-28
[TDD][Codewars] Mumbling
- 1687
- 0
- LeetCode 練功房
Codewars 上的 kata: Next bigger number with the same digits
You have to create a function that takes a positive integer number and returns the next bigger number formed by the same digits:
f(12) == 21
f(513) == 531
f(2017) == 2071If no bigger number can be composed using those digits, return -1:
f(9) == -1
f(111) == -1
f(531) == -1