Pergunta de entrevista da empresa American Express

Program. Write a code for following. for string=1462 calculate from right most to left in this manner 2+(6*2)+4+(1*2) [where every II, Iv, vi, .. should be multiplied by 2 and the sum should be divided by10 if quotient is 0 then print true otherwise false 1462=2+(6*2)+4+(1*2) = 20%10=0 (true) 1764526=6+(2*2)+5+(4*2)+6+(7*2)+1=44%10!=0(false)

Resposta da entrevista

Sigiloso

5 de set. de 2018

public class MyClass { public static void reverse(int[] array){ for(int left = 0, right = array.length - 1; left