Nov-24-2020, 09:03 PM
Hello guys,
Have you got any sugesstions how to optimize my code?
I would like to use maybe other solution to compile faster.
Thank you for any sugesstions
Have you got any sugesstions how to optimize my code?
I would like to use maybe other solution to compile faster.
Thank you for any sugesstions
def countit(numericals=[1, 1, 2, 2, 3, 3], h=1): pol = 0 sort = list(dict.fromkeys(numericals)) for x in sort: dodaj = x + h for y in sort: if dodaj == y: pol = 1 + pol else: pass return pol print(countit())