369

ABC 369

Problem 47 of 50

Easy

What to do

You have two numbers, A and B. You need to find out how many different numbers, x, can be arranged with A and B to form a sequence where the difference between the first and second number is the same as the difference between the second and third number.

Key Concepts

Basic arithmetic Condition checking Looping through possible values Understanding sequences

Examples

Input: 5, 7

Output: 3

Input: 6, 1

Output: 2

Tips for Beginners

  • Focus on understanding the logic, not memorizing syntax
  • Use print statements to debug your code
  • Don't worry about input parsing - the function handles that for you
  • If stuck, try writing out your solution on paper first

Python Editor

Loading Python...