I've started using leetcode recently and noticed something about the code to start a problem (I do them in Python). They always start with lines like this:
class Solution:def lengthOfLastWord(self, s: str) -> int: OR
class Solution:def plusOne(self, digits: List[int]) -> List[int]:
to me this is just distracting and makes me think I always have to solve the problems using OOP. Most importantly, is it useful or necessary to solve them in this format or can I ignore it and start from nothing? Also, is it trying to hint at something or convey specific information? Any clarification on this would greatly appreciated.
Tried to find online resources but these questions don't come up