-
Notifications
You must be signed in to change notification settings - Fork 382
Closed
Description
LeetCode Username
Kalash655
Problem Number, Title, and Link
- Two sum
Bug Category
Problem description, Incorrect or missing "Related Topics"
Bug Description
When defining a method inside a class, I forgot to include self as the first parameter in the twoSum method. As a result, when the method was called using Solution().twoSum(...), Python raised a TypeError stating that 3 arguments were given but only 2 were expected.
Language Used for Code
Python/Python3
Code used for Submit/Run operation
Expected behavior
Define a class Solution with a method twoSum(nums, target) that:
Takes a list of integers (nums) and a target number (target)
Returns the indices of two numbers in the list that add up to the target
Screenshots
No response
Additional context
No response
Metadata
Metadata
Assignees
Labels
No labels