我有第一个工程部分,但第二个不not.Here是问题 Question with which i am having the issue.Has sample input and output无法解决这一问题
这个问题了,我试图让2 solutions.The一些问题的代码以下是其中我写
number=int(input())
S=input()
w=list(S[:])
w_count=0
other_count=0
v_count=0
vv_count=0
i=0
while(i<(len(w))):
try:
if w[i]=='w':
w_count+=1
elif w[i]=='v' and w[i+1]=='v':
vv_count+=1
i+=1
else:
other_count+=1
except IndexError:
pass
i+=1
max_length=w_count*2+other_count+v_count
min_length=0
min_length=w_count+other_count+vv_count
print(min_length,max_length)
其他逻辑已经用的帮助下用于环路中实现的2码为哪些3测试用例传递
for value in range(len(w)):
try:
if w[value]=='w':
w_count+=1
elif w[value]=='v' and w[value+1]=='v':
vv_count+=1
else:
other_count+=1
except IndexError:
pass
问题寻求帮助调试(**“为什么不是这个代码的工作? “**)必须包含所需的行为,*特定的问题或错误*,以及*在问题本身**中重现**所需的最短代码。没有**明确问题陈述**的问题对其他读者没有用处。请参阅:[如何创建最小,完整和可验证示例](http://stackoverflow.com/help/mcve)。 – MattDMo