loading...

re: Daily Challenge #132 - Is my friend cheating? VIEW POST

FULL DISCUSSION
 
def remove_number(number):
  sequence = []
  for i in range(number):
    sequence.append(number - i)
  index_one = 0
  index_two = 0
  while index_one < len(sequence):
    if sequence[index_one] * sequence[index_two] == sum(sequence) - (sequence[index_one] + sequence[index_two]):
      return [sequence[index_one], sequence[index_two]]
    if index_two < len(sequence) - 1:
      index_two += 1
    else:
      index_two = 1
      index_one += 1
  return []
Code of Conduct Report abuse