LeetCode 556 Next Greater Element III (Med, Java, O(n))
Problem Statement
556. Next Greater Element III
Given a positive integer n, find the smallest integer which has exactly the same digits existing in the integer n and is greater in value than n. If no such positive integer exists, return -1.
Note: T...
huanganni.hashnode.dev5 min read