Remove Duplicates & Find 2nd Largest in Python | HackerRank Solution Explained
Автор: NeoTech
Загружено: 2025-08-22
Просмотров: 43
Описание:
🚀 Learn how to solve the HackerRank "Runner-Up Score" problem in Python step by step!
We’ll remove duplicates, use set() + max(), and find the 2nd largest number in just a few lines of clean Python code.
Code (Quick Copy):
n = int(input().strip())
arr = list(map(int, input().split()))
unique_scores = set(arr)
unique_scores.remove(max(unique_scores))
print(max(unique_scores))
✅ Perfect for:
Python beginners
HackerRank / LeetCode practice
Coding interviews
Quick Python tricks
📌 Watch more HackerRank Python solutions here: [Your Playlist Link]
📌 Short version of this video: / shorts [YOUR_SHORT_LINK]
#Python #HackerRank #Coding
Повторяем попытку...
Доступные форматы для скачивания:
Скачать видео
-
Информация по загрузке: