feat: solution correctly finds number but has complexity of O(10**n). Needs an algorithm for better results
This commit is contained in:
parent
3f835172e6
commit
63897a7fe5
9
src/codewars/kata_doubly_not_less.py
Normal file
9
src/codewars/kata_doubly_not_less.py
Normal file
@ -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)
|
||||||
Loading…
x
Reference in New Issue
Block a user