Type error: int() argument must be a string, a bytes-like object or a number, not ‘builtin_function_or_method’ [closed]

  binary, list, python-3.x, typeerror

To solve the problem stated in this[1] exercise, I have been helped to the following solution:

cols=int(input())
data=bin(int(input))[2:]
data = [data[-i-1::-cols] for i in range(cols)]
heights = [col.index("0") for col in data]
print(max([(i,a) for i, a,b,c in enumerate(zip(heights[:-2], heights[1:-1], heights[2:])) if a==b==c], key=lambda x: x[1])[0])

However, line 2 returns a TypeError as stated in the title. What would you do to improve this code?

[1]
https://docs.google.com/document/d/1-BEgydW32_mDaM7cuUbidYUk8bUgD_4jMcpd-pH07Xc/edit?usp=sharing

Source: Python-3x Questions

LEAVE A COMMENT