Writing in Python is like writing pseudocode. Suppose you know, that
\[ e^x=\sum_{k=0}^\infty \frac{1}{k!}x^k = 1 + x + \frac{x^2}{2!} + \dots \]What do you think, how much memory does INT take?
Can it be depending on the platform:
struct _longobject {
// macros with
// 1. the object’s reference counter (8 bytes)
// 2. and a pointer to the corresponding type object (8 bytes)
// 3. and extension field ob_size (8 bytes)
PyObject_VAR_HEAD
// int value adds 0, 4 (32x) or 8 bytes (64x)
digit ob_digit[1];
};
Given a list of integers and a specified integer, return the indices of two numbers from the list, the sum of which equals the specified number (target).
It is assumed that there is exactly one solution and the same element cannot be used twice.