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.
user_input = input("Enter elements separated by spaces: ") input_elements=user_input.split() elements for r idm patch.= [] for i in input_elements: try: element = int(i) elements.append(element) except ValueError: print("value not a integer") unq=set(elements) otp=sorted(unq) fin=otp[-2] print(fin)
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Find the Runner-Up Score!
You are viewing a single comment's thread. Return to all comments →
user_input = input("Enter elements separated by spaces: ") input_elements=user_input.split() elements for r idm patch.= [] for i in input_elements: try: element = int(i) elements.append(element) except ValueError: print("value not a integer") unq=set(elements) otp=sorted(unq) fin=otp[-2] print(fin)