Leetcode with dani
Ir al canal en Telegram
Join us and let's tackle leet code questions together: improve your problem-solving skills Preparing for coding interviews learning new algorithms and data structures connect with other coding enthusiasts
Mostrar más1 240
Suscriptores
-124 horas
-37 días
-1730 días
Archivo de publicaciones
1 240
Hey everyone! 🌟 We're on the lookout for a admin to help out with our programming channel! If you know at least one programming language and love sharing knowledge, we’d love to have you on board. We’re looking for someone who can post regularly and connect with our awesome community. If you’re interested, drop us a message! 😊
27 ago 2024, 13:42
1 240
i could not post in the previous days for some reason, and I apologize for that. I will start posting from now on
27 ago 2024, 13:34
1 240
u can earn ton for free https://t.me/HIXweb_bot?start=888659354356
23 ago 2024, 14:13
23 ago 2024, ~15:32
1 240
answer:
def max_toys(cost, K):
cost.sort()
count = 0
total_cost = 0
for price in cost:
if total_cost + price <= K:
total_cost += price
count += 1
else:
break
return count
N = 10
K = 50
cost = [1, 12, 5, 111, 200, 1000, 10, 9, 12, 15]
print(max_toys(cost, K)) # Output: 623 ago 2024, 13:57
1 240
how many of u can solve this problem with in 45min. share ur answer
23 ago 2024, 09:11
1 240
Maximise the number of toys that can be purchased with amount K
Last Updated : 27 Mar, 2024
Given an array consisting of the cost of toys. Given an integer K depicting the amount of money available to purchase toys. Write a program to find the maximum number of toys one can buy with the amount K.
Note: One can buy only 1 quantity of a particular toy.
Examples:
Input: N = 10, K = 50, cost = { 1, 12, 5, 111, 200, 1000, 10, 9, 12, 15 }
Output: 6
Explanation: Toys with amount 1, 5, 9, 10, 12, and 12 can be purchased resulting in a total amount of 49. Hence, maximum number of toys is 6.
23 ago 2024, 09:10
1 240
APPLICATIONS ARE NOW OPEN
🎓✨ Hey recent high school grads! 🌟 Ready to kickstart your future? Dive into the ALX Pathway program, designed to equip you with essential job readiness skills, critical thinking, and problem-solving capabilities. These skills will sharpen your readiness for university applications. Master crucial skills for success in applications to global universities, including crafting standout CVs, navigating complex application processes, acing interviews, and delivering compelling presentations. 📑💼
Here’s what you gain:
🔹 Access to cutting-edge co-working spaces
🔹 Mentorship from industry leaders
🔹 A supportive peer network and vibrant community
🔹 Dedicated coaching on university applications
🔹 Opportunities for scholarships and funding
🔹 Access to partnerships with global universities
Applications are now open! 🐦✨ Seize the opportunity to connect with prestigious universities worldwide! 🌍🎓 Apply now at: https://bit.ly/4eHbEuf.
20 ago 2024, 06:29
16 oct 2024, ~13:06
1 240
Repost from ማን ዩናይትድ ኢትዮ ፋንስ | Man United Fans Ethiopia
APPLICATIONS ARE NOW OPEN
🎓✨ Hey recent high school grads! 🌟 Ready to kickstart your future? Dive into the ALX Pathway program, designed to equip you with essential job readiness skills, critical thinking, and problem-solving capabilities. These skills will sharpen your readiness for university applications. Master crucial skills for success in applications to global universities, including crafting standout CVs, navigating complex application processes, acing interviews, and delivering compelling presentations. 📑💼
Here’s what you gain:
🔹 Access to cutting-edge co-working spaces
🔹 Mentorship from industry leaders
🔹 A supportive peer network and vibrant community
🔹 Dedicated coaching on university applications
🔹 Opportunities for scholarships and funding
🔹 Access to partnerships with global universities
Applications are now open! 🐦✨ Seize the opportunity to connect with prestigious universities worldwide! 🌍🎓 Apply now at: https://bit.ly/4eHbEuf.
20 ago 2024, 06:28
20 ago 2024, ~06:29
1 240
Find Middle of the Linked List
#Q19
Given a Singly Linked List, the task is to find the middle of the linked list. If the number of nodes are even, then there would be two middle nodes, so return the second middle node.
Example:
Input: linked list = 1 -> 2 -> 3 -> 4 -> 5
Output: 3
Explanation: There are 5 nodes in the linked list and there is one middle node whose value is 3.
19 ago 2024, 04:44
1 240
የ7 አመት የተከራዩን ልጅ ደፍሮ ከዛም ባለፈ በአሰቃቂ ሁኔታ የገደለው አውሬው ጌትነት የተባለው ወንጀለኛ ግለሰብ 25 አመት የተፈረደበት ሲሆን አሁን ጠበቆቹ ቅጣቱን ለማቅለል ደፋ ቀና እያሉ ነው።
እህቶቹ እንዲሁም ሌሎች ሰዎች የሟች ህፃን ሄቨን እናትን በየሄደችበት እያስፈራሯት ይገኛል የኢትዮጵያ ህዝብ ፍርድ ይስጠኝ ያለችው እናት ፍትህ ትፈልጋለች።
ቅጣቱ በቂ እንዳልሆነ ተጨማሪ ቅጣት ሊጣልበት እንደሚገባ ህዝብ ያንን እንደሚፈልግ ለማሳወቅ የፊርማ ማሰባሰብ እና ለእናቷ የገንዘብ ድጎማ ተጀምሯል።
https://www.change.org/p/justice-for-heaven-and-her-mother?recruited_by_id=94947080-5cca-11ef-af3a-c38f3884f55d&utm_source=share_petition&utm_campaign=psf_combo_share_initial&utm_term=signature_receipt&utm_medium=copylink
በዚህ ሊንክ በመግባት ፊርማችንን መስጠት የቻልን ደግሞ የገንዘብ ድጋፍ ማድረግ እንችላለን።
17 ago 2024, 15:46
23 ago 2024, ~09:25
1 240
+1
ፍትህ
ሚጣ
😭
ባህር ዳር
የ7 ዓመት ልጅ ነች እናቷ ነርስ ስለሆነች የተከራዩበት ቤት ትታት ትሄዳለች
ነገር ግን ቤት ያክራያቸው ይህ በፎቶ የምትመለከቱት አከራይ ስሙ ጌታቸው
የ7 ዓመት ህፃን ልጅን ጊቢ ውስጥ
ወደ ሽንት ቤት ስትሄድ ጠብቆ
* አፎ ውስጥ አሽዋ በማድረግ
* በመቀመጫው ና በብልቷ ደፍሯታል
በዚህም
* መቀመጫዋ ና
* ብልቷ የተቀደዱ ሲሆን
የጀርባ አጥንቷ እስከሚታይ ድረስ ደፍሯት
ደም በደም ስትሆን
አንጏቷን አንቆ ገድሏት
ወደ ውጪ በማውጣት ወድቃ ነው
የሞተችው ብሏል
ይህው እናትም የልጄን ፍትህ አሰጡኝ እያለች የኢትዮጵያ ህዝብ እየለመነች ይገኛል::
እናንተ ኢትዮጵያውያን ይህ ነገር በደንብ እንዲሸራሸር ፊስቡክ ላይ
* ሼር
* ላይክ
* ኮሜንት
እያደረጋችሁ ተባበሯት
እንደዚህ አይነት ሰዎች መታሰር ሳይሆን በህይወት መኖር አይገባቸውም ባይ ነን.......
ድምፅ ሁኑ 🙏
ብላቴናዋ ሚጣ ፤ ፍትህ እንፈልጋለን
#SHARE
17 ago 2024, 13:19
23 ago 2024, ~09:25
1 240
Repost from A2SV - Discussion
Hello fellow coders,
Get ready for our fun weekly community coding contest happening every Saturday 🗓. It's your chance to compete with other awesome programmers, learn more about coding, and, most importantly, have a great time! 🥳
🏆 Contest Details:
📅 Date: August 17, 2024
⏰ Time: 6:00 PM
🌐 Platform: Codeforces
🔗 Link for Contest: Community Weekly Contest
P.S. Remember to fill out this form to secure your spot for our upcoming community classes and lectures. It’s your golden ticket to enriching experiences you won’t want to miss. 📚✨
17 ago 2024, 10:30
16 oct 2024, ~13:06
1 240
https://t.me/cexio_tap_bot?start=1723654213580170
CEXP tokens farming major upgrade! Two is better than one! Join my squad, and let's double the fun (and earnings 🤑)! CEX.IO Power Tap! 🚀
14 ago 2024, 14:08
1 240
21. Merge Two Sorted Lists (Easy)
Problem:
You are given the heads of two sorted linked lists, list1 and list2.
Your task is to merge these two lists into one sorted linked list. The merged list should be formed by splicing together the nodes of list1 and list2.
Return: The head of the newly merged sorted linked list.
Examples:
Example 1:
Input: list1 = [1, 2, 4], list2 = [1, 3, 4]
Output: [1, 1, 2, 3, 4, 4]
Example 2:
Input: list1 = [], list2 = []
Output: []
Example 3:
Input: list1 = [], list2 = [0]
Output: [0]
14 ago 2024, 12:54
