diff --git a/src/codewars/kata_doubly_not_less.py b/src/codewars/kata_doubly_not_less.py index 687b458..b8dda3e 100644 --- a/src/codewars/kata_doubly_not_less.py +++ b/src/codewars/kata_doubly_not_less.py @@ -1,9 +1,11 @@ def doubly_not_less(n): - n_int = m = int(n) - m_condition = int("".join([str(x) for x in [int(x) for x in n][::-1]])) + n_int = int(n) - while m_condition < n_int: - m += 1 - m_condition = int("".join([x for x in str(m)][::-1])) + # function reverses the order of a string of numbers to int + reverse = lambda x: int("".join([str(item) for item in [int(x) for x in x][::-1]])) - return str(m) + if reverse(n) >= n_int: + return n + return None + +print(doubly_not_less("23456")) \ No newline at end of file