I'm trying a simple program to solve a UVa question (11683 - Laser Sculpture, https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=2730)
I wrote below code as the answer (which was marked as wrong).
from sys import stdin
for line in stdin:
if line.strip() == '0':
exit(0)
else:
h, l = map(int, line.split()[:2])
heights = stdin.readline()
x = h
heights = map(int, heights.strip().split()[:l])
count = 0
for height in heights:
if height < x:
count += (x - height)
x = height
print(count)
While debugging this, I observed that CMD python prompt has a limit on the maximum size of the input. It doesn't allow me to type after 512 characters in a single line.
Is there a way to increase this limit?
