Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0a78ffa

Browse files
authored
Merge pull requestneetcode-gh#1 from kaushikdaiv7/kaushikdaiv7-patch-1
Create 2483-minimum-penalty-for-a-shop.py
2 parents5c2d9e0 +3dce9c1 commit0a78ffa

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
classSolution:
2+
defbestClosingTime(self,customers:str)->int:
3+
4+
curPenalty=res=minPenalty=0
5+
6+
fori,eleinenumerate(customers):
7+
ifele=='Y':
8+
curPenalty-=1
9+
ifcurPenalty<minPenalty:
10+
res=i+1
11+
curPenalty=minPenalty
12+
else:
13+
curPenalty+=1
14+
15+
returnres

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp