name = "two_sum" category = "algorithm" mode = "solve" description = """ Read input from stdin. The first line contains a target integer. The second line contains space-separated integers (the array). Find two indices (0-based) such that the numbers at those indices add up to the target. Print the two indices on a single line, space-separated, smaller index first. There is exactly one solution. """ [[test_cases]] stdin = """9 2 7 11 15""" expected_stdout = "0 1" [[test_cases]] stdin = """6 3 2 4""" expected_stdout = "1 2" [[test_cases]] stdin = """6 3 3""" expected_stdout = "0 1"