Can you solve this question? #python #dsa #logicbuilding #coding

preview_player
Показать описание
Welcome to Code and Debug, your one-stop platform to master coding and crack job interviews! 🚀

💡 What We Offer:
1. Expert tutorials on Python, Data Structures, and Algorithms.
2. Quick tips and tricks to ace coding interviews.
3. Real-world examples and hands-on practice.

📞 Contact us: +91-9712928220

📅 Join Our Courses: Transform your skills with our industry-aligned training programs!
More than 15,000 students have already trusted us for their success.

🔔 Subscribe Now
Stay updated with our latest Shorts, tutorials, and live sessions! Let's make coding simple and fun.

Follow us on Instagram: @codeanddebug
Join our community, and let’s code our way to success! 💻✨
Рекомендации по теме
Комментарии
Автор

price1 = [6, 4, 5, 0]
price2 = [4, 5, 0, 0, 0]
dict_1 = {}
dict_2 = {}
result = []

# Frequency map for price1
for i in price1:
dict_1[i] = dict_1.get(i, 0) + 1

# Frequency map for price2
for j in price2:
dict_2[j] = dict_2.get(j, 0) + 1

# Elements in price2 not in price1
res1 = []
for j in price2:
if j not in dict_1:
res1.append(j)
result.append(res1)

# Elements in price1 not in price2
res2 = []
for i in price1:
if i not in dict_2:
res2.append(i)
result.append(res2)

print(result)

VaibhavJoshii
join shbcf.ru