Leetcode with dani @zethioprograming Channel on Telegram

Leetcode with dani

@zethioprograming


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

Leetcode with dani (English)

Are you looking to improve your problem-solving skills and prepare for coding interviews? Look no further than 'Leetcode with dani' Telegram channel! Led by the username @zethioprograming, this channel is a hub for individuals who are eager to tackle Leetcode questions, learn new algorithms and data structures, and connect with other coding enthusiasts. Whether you are a beginner looking to sharpen your skills or an experienced coder seeking to stay ahead of the game, this channel is the perfect place for you. Join us today and embark on a journey towards becoming a more proficient coder. Let's tackle Leetcode questions together and take your coding skills to the next level!

Leetcode with dani

21 Nov, 14:23


🎯 Problem of the Day: Sort Colors

Problem Description
You are given an array nums with \( n \) objects colored red, white, or blue. Sort the array in-place so that objects of the same color are adjacent, with the colors in the order red, white, and blue.
- Represent the colors using integers:
- 0 β†’ Red
- 1 β†’ White
- 2 β†’ Blue

⚠️ Note: You must not use the library's sort function.

---

Example 1
Input:
nums = [2,0,2,1,1,0]

Output:
[0,0,1,1,2,2]


Example 2
Input:
nums = [2,0,1]

Output:
[0,1,2]


---

πŸ“ Practice Questions for A2SV Preparation
1. Core Problem:
- Solve LeetCode 75: Sort Colors () using Dutch National Flag Algorithm for \( O(n) \) time complexity.

2. Related Problems:
- LeetCode 215 : Kth Largest Element in an Array
- LeetCode 347 : Top K Frequent Elements
- LeetCode 56 : Merge Intervals

3. Challenge Problem:
- LeetCode 88: Merge Sorted Array

---

πŸ’‘ Tip: Use a two-pointer or three-pointer approach to keep track of boundaries for the different colors! Try to optimize your solution to \( O(n) \) in both time and space.

🧠 Share your solution and discuss your approach with the community! 🌟

Leetcode with dani

21 Nov, 12:45


Hello G6 In-Person Education Applicants,

As you gear up for your interviews, we want to inform you about the key topics to focus on. These are the areas that will be covered during the interview:

- Sorting
- Two Pointers
- Sliding Window
- Prefix Sum
- Stacks and Queues

Best of luck with your preparation! Stay confident and ready to showcase your skills.

Leetcode with dani

19 Nov, 20:04


α‹ˆαŠ•α‹΅αˆ›α‰½αŠ• α‰°αˆ›αˆͺ αŠ α‹²αˆ± αŠ αŒˆα‹˜ α‹¨αŠ .አ.α‹© /CNCS የChemistry α‹²α“αˆ­α‰΅αˆ˜αŠ•α‰΅ α‰°αˆ›αˆͺ αˆ²αˆ†αŠ• α‰ α‹΅αŠ•αŒˆα‰°αŠ› α‹¨αŒ€αŠ“ αŠ₯ክል αˆαŠ­αŠ•α‹«α‰΅ α‰ αŒ₯α‰αˆ­ αŠ αŠ•α‰ αˆ³ αˆ΅α”αˆ»αˆ‹α‹­α‹α‹΅ αˆ†αˆ΅α’α‰³αˆ α‹¨αˆ…αŠ­αˆαŠ“ αŠ­α‰΅α‰΅αˆ αŠ₯α‹¨α‰°α‹°αˆ¨αŒˆαˆˆα‰΅ α‹­αŒˆαŠ›αˆα’ αˆ†αŠ–αˆ αŒαŠ• αˆˆαˆ…αŠ­αˆαŠ“αŠ“ αˆˆαŠ αŠ•α‹³αŠ•α‹΅ α‹ˆαŒͺα‹Žα‰½ α‹¨αˆšαˆ†αŠα‹αŠ• αŒˆαŠ•α‹˜α‰₯ αˆ˜αˆΈαˆαŠ• αˆ΅αˆ‹αˆα‰°α‰»αˆˆ ለαŠ₯αˆ­α‹³α‰³ αˆ²α‰£αˆ α‰£αˆˆ3 αŒ₯ምር α‹¨α‰£αŠ•αŠ­ αŠ αŠ«α‹αŠ•α‰΅ α‰°αŠ¨αα‰Ά αŠ α‰…αˆ α‹¨αˆα‰€α‹°α‹αŠ• αŠ₯αŠ“ ልα‰₯ α‹¨α‹ˆα‹°α‹°α‹αŠ• αŒˆα‰’ α‰ αˆ›α‹΅αˆ¨αŒ የαŠ₯αˆ­α‹³α‰³ αŠ₯αŒƒα‰½αˆαŠ• αŠ₯αŠ•α‹΅α‰΅α‹˜αˆ¨αŒ‰αˆαŠ• αˆ΅αŠ•αˆ α‰ αˆαŒ£αˆͺ ሡም αŠ₯αŠ•αŒ α‹­α‰ƒαˆˆαŠ•α’

α‹΅αˆ­ α‰’α‹«α‰₯ር...

1000660602899 Surafel and Lud and Belete (CBE)

αˆˆαˆ˜αˆ¨αŒƒ: 0928750009

Leetcode with dani

15 Nov, 20:06


FOR A2SV

Leetcode with dani

14 Nov, 12:03


Applications are Open for A2SV G6 Education!

The time has come for A2SV to welcome new members! We’re looking for team-oriented individuals with a never-give-up mentality, ready to drive tech excellence and solve impactful challenges.

πŸ“… Application opens: November 14, 2024
πŸ“… Deadline: November 20, 2024, at 11:59 PM EAT

πŸŽ“ Eligibility

Open to current students from Addis Ababa University (AAU), Addis Ababa Science and Technology University (AASTU), and Adama Science and Technology University (ASTU). If you're not from these schools or have already graduated, stay tuned for future remote applications!

πŸ” Requirements

- Familiarity with at least one programming language
- Experience with platforms like LeetCode or Codeforces
- Completed at least 40 problems on LeetCode or Codeforces

πŸ€– Selection Process

- First Round Filtering: Initial application review
- Technical & Behavioral Interviews: For selected candidates, to assess skills and fit for the program

βŒ›οΈ Don’t wait! Start your application early to ensure a standout submission. 🎯

πŸ”— Apply now: link

#A2SV #TechEducation #EmpoweringAfrica #ApplyNow

Leetcode with dani

09 Nov, 11:32


So, the prime numbers are the unmarked ones: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89 and 97.

Leetcode with dani

09 Nov, 11:32


We continue this process, and our final table will look like below:

Leetcode with dani

09 Nov, 11:32


We move to our next unmarked number 5 and mark all multiples of 5 and are greater than or equal to the square of it.

Leetcode with dani

09 Nov, 11:32


Now we move to our next unmarked number 3 and mark all the numbers which are multiples of 3 and are greater than or equal to the square of it.

Leetcode with dani

09 Nov, 11:32


According to the algorithm we will mark all the numbers which are divisible by 2 and are greater than or equal to the square of it.

Leetcode with dani

09 Nov, 11:32


Let us take an example when n = 100. So, we need to print all prime numbers smaller than or equal to 100.


We create a list of all numbers from 2 to 100.

Leetcode with dani

09 Nov, 11:32


Sieve of Eratosthenes

Given a number n, print all primes smaller than or equal to n. It is also given that n is a small number.

Example:

Input : n =10
Output : 2 3 5 7


Input : n = 20
Output: 2 3 5 7 11 13 17 19

The sieve of Eratosthenes is one of the most efficient ways to find all primes smaller than n when n is smaller than 10 million or so.

Following is the algorithm to find all the prime numbers less than or equal to a given integer n by the Eratosthene’s method:
When the algorithm terminates, all the numbers in the list that are not marked are prime.

Explanation with Example:

Leetcode with dani

08 Nov, 06:24


Given a number n, print all primes smaller than or equal to n. It is also given that n is a small number.

Example:

Input : n =10
Output : 2 3 5 7


Input : n = 20
Output: 2 3 5 7 11 13 17 19

Leetcode with dani

05 Nov, 18:31


share ur answer in the comment section , i will check it

Leetcode with dani

05 Nov, 12:20


πŸ† LeetCode 490. The Maze (Premium) πŸ†

There's a ball in a maze with:
- Empty spaces (0) and walls (1).

The ball can roll in any direction:
- Up, down, left, or right 🌐

But here's the catch:
- It won't stop until it hits a wall! 🚧
- Once it stops, it can choose another direction to roll.

### Task 🎯
Given:
- An m x n maze
- The ball's starting position and a destination

Determine:
- Can the ball stop at the destination?
- If yes, return true. Otherwise, return false.

πŸ“ Assumption: All borders of the maze are walls.

---

### Examples πŸ”

Example 1:

Input: 
maze = [
[0,0,1,0,0],
[0,0,0,0,0],
[0,0,0,1,0],
[1,1,0,1,1],
[0,0,0,0,0]
],
start = [0,4],
destination = [4,4]

Output: true

Explanation: One possible path: left ➑️ down ➑️ left ➑️ down ➑️ right ➑️ down ➑️ right 🎯

---

Example 2:

Input:
maze = [
[0,0,1,0,0],
[0,0,0,0,0],
[0,0,0,1,0],
[1,1,0,1,1],
[0,0,0,0,0]
],
start = [0,4],
destination = [3,2]

Output: false

Explanation: The ball can pass through the destination, but it cannot stop there. ❌

---

Example 3:

Input:
maze = [
[0,0,0,0,0],
[1,1,0,0,1],
[0,0,0,0,0],
[0,1,0,0,1],
[0,1,0,0,0]
],
start = [4,3],
destination = [0,1]

Output: false


---

### Constraints πŸ“
- Maze Dimensions: 1 ≀ m, n ≀ 100
- Cells contain only 0 (empty) or 1 (wall).
- Start and destination are in empty spaces and won’t initially overlap.

Can you solve it? πŸ€”

Leetcode with dani

02 Nov, 12:11


Hello fellow coders,

After a brief break, we've returned! 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: November 2, 2024
⏰ Time: 6:00 PM
πŸ”— Link for Contest: Community Weekly Contest Return - Contest No 1

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. πŸ“šβœ¨