Pergunta de entrevista da empresa Odessa

questions Lcm and addition of array 1 hour time

Respostas da entrevista

Sigiloso

13 de jun. de 2018

Python solution in O(n) time. l=list(map(int,input().split()) s=sum(l) #it gives the sum of array in O(n) time. for i in l: print(s-i,' ')

1

Sigiloso

7 de jul. de 2017

superrr

5

Sigiloso

15 de jun. de 2017

easy

14

Sigiloso

21 de jun. de 2017

code for array of numbers addition where enter n,enter n array elemts ,first line specifies add other numbers except first index store in an another array,second line except second index add other. ex-4 1 2 3 4 output: 9, 8, 7, 6 programming #include main() { int arr[10],n,i,j,ri,res[10],sum=0; scanf("%d",&n); for(i=1;i<=n;i++) { scanf("%d",&arr[i]); } for(j=1;j<=n;j++) { for(i=1;i<=n;i++) { sum+=arr[i]; } ri++; sum=sum-arr[j];//to subtract respective index value res[ri]=sum;//to store res array to print ri is important to refer index sum=0;//to calculate further value } for(i=1;i<=n;i++) { if(i

9