You are viewing a single comment's thread. Return to all comments →
if name == 'main':
n = int(input())
arr = list(map(int, input().split()))
for i in arr:
if i not in listnew:
hey I am new to python here.can u tell me what is significance of map keyword while taking inputs.
python map() is an iterator.so that we can iterate over elements.
can be converted to tuple ,lists
map is also very usefull to use lambda functinons and it applies function to all items in the input list
yes!!one more point!!
Was very helpful
it wont work for multiple max value...
When I tested a few custom test cases with multiple custom values and they passed. Unless, you think there's a test case I missed? If so, I'm curious which test case would this fail?
for every element you are checking the list for its existance which iterates list every time. so it may not so efficient.
yes, thats why you should try this
Hello , can you expain it clearly cause i want to understand how to write in a single line like you.
Amazing!! Simplicity at its best
Wow did not understand this for a hot second. S/o you though, this is good stuff imo even though my opinion as a noob isn't much.
nusta indentation error...
This code will fail if largest number occures multiple time.