Skip to content

Missing Test Case - 1. Two Sum #32243

@Kalash0098

Description

@Kalash0098

LeetCode Username

Kalash655

Problem Number, Title, and Link

  1. 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
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions