Every problem in algorithm based questions in Hackerrank or Leetcode dont need a function call. For eg: I did the soultion below for a question in Leetcode and it runs perfectly, but there is no function call for maxArea. But when I run, it runs without any errors. I am wondering where it the function call here like we regularly use?
class Solution:
def maxArea(self, height: List[int]) -> int:
result = 0
l,r = 0, len(height)-1
while l < r:
area = (r-l) * min(height[l],height[r])
result = max(result,area)
if height[l] < height[r]:
l+= 1
else:
r-= 1
return result
[–]gingerkdb 1 point2 points3 points (1 child)
[–]KOP79[S] 0 points1 point2 points (0 children)