InterviewBit Academy is now Scaler!
Learn Tech Skills from Scratch @ Scaler EDGE

Total Moves For Bishop!


Problem Description

Given the position of a Bishop (A, B) on an 8 * 8 chessboard.

Your task is to count the total number of squares that can be visited by the Bishop in one move.

The position of the Bishop is denoted using row and column number of the chessboard.



Problem Constraints

1 <= A, B <= 8



Input Format

First argument is an integer A denoting the row number of the bishop.

Second argument is an integer B denoting the column number of the bishop.



Output Format

Return an integer denoting the total number of squares that can be visited by the Bishop in one move.



Example Input

Input 1:

 A = 4
 B = 4


Example Output

Output 1:

 13


NOTE: You only need to implement the given function. Do not read input, instead use the arguments to the function. Do not print the output, instead return values as specified. Still have a doubt? Checkout Sample Codes for more details.
Start solving Total Moves For Bishop! on Interview Code Editor
Sign Up
to access hints and editorial solutions for Total Moves For Bishop!
Asked In:

Discussion


Loading...
Click here to start solving coding interview questions