title: Unable to solve this issue with the code
body: <p>I am having some issues with this question for which i have tried to make 2 solutions.The first one works partially but the second one does not.Here is the question
  <a href="https://www.hackerearth.com/practice/basic-programming/implementation/basics-of-implementation/practice-problems/algorithm/illegible-string/" rel="nofollow">Question with which i am having the issue.Has sample input and output</a></p>
  
  <p>Here are the 2 codes which i have written</p>
  
  <pre><code>number=int(input())
  S=input()
  w=list(S[:])
  
  
  
  w_count=0
  other_count=0
  v_count=0
  vv_count=0
  
  i=0
  
  while(i&lt;(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)
  </code></pre>
  
  <p>The other Logic has been implemented with  the help of a for loop for which 3 test cases are passing</p>
  
  <pre><code>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
  </code></pre>