Write a program to find the odd man out in the given multiplication series. If there is no odd man, then return 0.
Input (int[]) | Output (int) |
---|---|
{20, 60, 180, 540, 1620, 4890} | 4890 |
{2, 3, 8, 16, 32, 64} | 3 |
{15, 32, 64, 128, 256} | 15 |
{9, 18, 36, 72, 140, 288, 576, 1152} | 140 |
{1, 11, 121, 1331, 14641, 161051} | 0 |
class OddManOutInMultiplicationSeries
{ public static void main(String s[])
{
int input[] = {20, 60, 180, 540, 1620, 4890};
System.out.println("The odd man is : " + findOddManOut(input));
}
public static int findOddManOut(int[] input) {
//Write code here to find the odd man out from the given multiplication series
}
}
Topic: Learn Arrays And Loops