How do we optimize code?

Asked 2 years ago, Updated 2 years ago, 16 views

arr = input().split()
M = int(arr[0])
N = int(arr[2])

X = 1
elevator = 1
start_n = 0

while start_n != N:
    if X < M:
        X += 1
        start_n += 1

    else:
        elevator += 1
        X = 1

print(elevator)

How can I make it faster?

python

2022-09-20 15:13

1 Answers

It looks like NYPC question number three If so, please drop the article.


2022-09-20 15:13

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.