fork download
  1. q = int(input())
  2. for i in range(q):
  3. cn = list(map(int, input().split()))
  4. n = cn[0]
  5. k = cn[1]
  6. l = list(map(str, input().split()))
  7. a = l.count('H')
  8. b = l.count('T')
  9. while (k > 0):
  10. if l[-1] == 'T':
  11. b = b - 1
  12. k = k - 1
  13. else :
  14. a = a - 1
  15. k = k - 1
  16. a, b = b, a
  17. l.pop()
  18. print(l.count('H'))
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
3
5 3
H T T H T
7 4
H H T T T H H
6 1
T H T H T T
compilation info
Traceback (most recent call last):
  File "/usr/lib/python3.7/py_compile.py", line 143, in compile
    _optimize=optimize)
  File "<frozen importlib._bootstrap_external>", line 791, in source_to_code
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "./prog.py", line 11
    b = b - 1
            ^
TabError: inconsistent use of tabs and spaces in indentation

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3.7/py_compile.py", line 147, in compile
    raise py_exc
py_compile.PyCompileError: Sorry: TabError: inconsistent use of tabs and spaces in indentation (prog.py, line 11)
stdout
Standard output is empty