Given program to write, which interviewer itself not able to explain, I solved it as per my understanding but his attitude was like he is superior
Given a 2D plane. You can move in any of the 4 directions in the first second. After the first second, you change direction by 90 degrees every second. For example, if you just moved north or south, the next step you take has to be either west or east and vice versa. In each second, you move 1 unit. You are given integer N.
Calculate the ambiguity value in your position that is defined by the number of different locations you can be after exactly N seconds.
Function description
Complete the function Ambuiguity(). This function takes the following parameter and returns the required answer:
N: Represents the number of seconds
Input format for custom testing
Note: Use this input format if you are testing against custom input or writing code in a language where we don’t provide boilerplate code
The first line contains an integer N denoting the number of seconds.
Output format
Calculate the ambiguity value in your position defined by the number of different locations you can be after exactly N seconds.
Constraints
1<=N<=1000