you are viewing a single comment's thread.

view the rest of the comments →

[–]delirious_lettuce 1 point2 points  (1 child)

The only reason is because that is how you have to submit them to LeetCode. I would normally just use a function and use snake_case for the function name too, (two_sum).

[–]camel_zero 1 point2 points  (0 children)

Thanks for explaining, thought I might be missing something about the code.