We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
So for the last various hours i am on this question.
The only thing i know is "several ways through which we cannot get an answer of this"
My final attempt for today "11 cases failed"
From 4.2 to 29.4 score
I dont know what i am missing
Help anyone
deftea(a,b):ifa<b:m1=am2=bifb<a:m1=bm2=areturn(((m1&m2)^(m1|m2))&(m1^m2))Stack1=Stack()n=int(input())l=list(int(_)for_ininput().split())arr_rev=l[::-1]ans=[]final=-1ifStack1.isEmpty():item=arr_rev.pop()Stack1.push(item)whilelen(arr_rev)>0:#print("Entering into the loop")ans.append(tea(Stack1.peek(),arr_rev[-1]))ifarr_rev[-1]<Stack1.peek():Stack1.pop()item1=arr_rev.pop()Stack1.push(item1)else:item1=arr_rev.pop()Stack1.push(item1)print(max(ans))
Please note that I have implemented Stack(), though i have not inserted the implementation here
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
AND xor OR
You are viewing a single comment's thread. Return to all comments →
So for the last various hours i am on this question. The only thing i know is "several ways through which we cannot get an answer of this"
My final attempt for today "11 cases failed" From 4.2 to 29.4 score I dont know what i am missing Help anyone
Please note that I have implemented Stack(), though i have not inserted the implementation here