From 63897a7fe56dcc1fc0f41ca72b7acef7799f0203 Mon Sep 17 00:00:00 2001 From: zimmersandro Date: Mon, 25 May 2026 18:55:41 +0200 Subject: [PATCH] feat: solution correctly finds number but has complexity of O(10**n). Needs an algorithm for better results --- src/codewars/kata_doubly_not_less.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 src/codewars/kata_doubly_not_less.py diff --git a/src/codewars/kata_doubly_not_less.py b/src/codewars/kata_doubly_not_less.py new file mode 100644 index 0000000..687b458 --- /dev/null +++ b/src/codewars/kata_doubly_not_less.py @@ -0,0 +1,9 @@ +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]])) + + while m_condition < n_int: + m += 1 + m_condition = int("".join([x for x in str(m)][::-1])) + + return str(m)