kyu_4.next_smaller_number_with_the_same_digits package
Submodules
kyu_4.next_smaller_number_with_the_same_digits.next_smaller module
Solution for -> Next smaller number with the same digits.
Created by Egor Kostan. GitHub: https://github.com/ikostan
- kyu_4.next_smaller_number_with_the_same_digits.next_smaller.find_x(n: int) int[source]
Find x.
- Parameters:
n – int
- Returns:
int
- kyu_4.next_smaller_number_with_the_same_digits.next_smaller.find_y(n: int, x_i: int) int[source]
Find y.
- Parameters:
n – int
x_i – int
- Returns:
int
- kyu_4.next_smaller_number_with_the_same_digits.next_smaller.next_smaller(n: int) int[source]
next_smaller function.
A function that takes a positive integer and returns the next smaller positive integer containing the same digits. If no smaller number can be composed using those digits, return -1 :param n: int :return: int
kyu_4.next_smaller_number_with_the_same_digits.test_next_smaller module
Test for -> Next smaller number with the same digits.
Created by Egor Kostan. GitHub: https://github.com/ikostan
Module contents
Next smaller number with the same digits package.