en
Feedback

Don't get caught by a cheater! Telemetrio finds and tags such channels πŸ‘‰ If you want to see the tag, subscribe

Leetcode with dani

Leetcode with dani

Open in 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

Show more
1 240
Subscribers
-124 hours
-37 days
-1730 days
Posts Archive
photo content
+1
06 Nov 2024, 10:00
06 Nov 2024, ~10:01

share ur answer in the comment section , i will check it
05 Nov 2024, 13:31

photo content
05 Nov 2024, 12:05

163. Missing Ranges.png0.94 KB
05 Nov 2024, 11:38
05 Nov 2024, ~11:38

163. Missing Ranges.png0.94 KB
05 Nov 2024, 11:37
05 Nov 2024, ~12:05

Repost from N/a
photo content
05 Nov 2024, 07:28

Repost from N/a
photo content
05 Nov 2024, 07:23

Repost from N/a
πŸ† 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? πŸ€”
05 Nov 2024, 07:20

if u want to join Contact me https://t.me/danicoder1
05 Nov 2024, 06:29
05 Nov 2024, ~07:58

🌟 Join Our LeetCode VIP Channel! 🌟 Unlock your coding potential for just 50 Birr (or $0.50)! Gain exclusive access to premium LeetCode questions, detailed solutions, and a supportive community to help you ace your coding interviews. Why join? β€’ Curated problems tailored for interview success β€’ Step-by-step solutions and tips β€’ Connect with fellow coders and share insights Don't miss out on this opportunity to level up your skills! Join now!
05 Nov 2024, 06:27
05 Nov 2024, ~07:58

Repost from A2SV - Discussion
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. πŸ“šβœ¨
02 Nov 2024, 08:11

28 Oct 2024, 14:38
30 Oct 2024, ~11:33

mokrut 500k spot yekeral
28 Oct 2024, 09:05
28 Oct 2024, ~14:37

bitget reward selazegaje mokrut just one click https://t.me/BitgetWallet_TGBot/BGW?startapp=sharetask-SPNPTCD7wpBmTF3 πŸŽβ“ You’re invited to unlock a mystery gift! β“πŸŽ First 1,000,000 only! Clicking this link guarantees your qualification. First come, first served, do not wait! Join me on Bitget Wallet Lite now!
28 Oct 2024, 08:33
28 Oct 2024, ~14:37

#Q21 #leet_codeQ1249 Medium title. Minimum Remove to Make Valid Parentheses Given a string s of '(' , ')' and lowercase English characters. Your task is to remove the minimum number of parentheses ( '(' or ')', in any positions ) so that the resulting parentheses string is valid and return any valid string. Formally, a parentheses string is valid if and only if: It is the empty string, contains only lowercase characters, or It can be written as AB (A concatenated with B), where A and B are valid strings, or It can be written as (A), where A is a valid string. Example 1: Input: s = "lee(t(c)o)de)" Output: "lee(t(c)o)de" Explanation: "lee(t(co)de)" , "lee(t(c)ode)" would also be accepted. Example 2: Input: s = "a)b(c)d" Output: "ab(c)d" Example 3: Input: s = "))((" Output: "" Explanation: An empty string is also valid. Constraints: 1 <= s.length <= 105 s[i] is either '(' , ')', or lowercase English letter.
21 Oct 2024, 02:10

Selection sort
def selection_sort(arr):
    n = len(arr)
    for i in range(n - 1):
      
        # Assume the current position holds
        # the minimum element
        min_idx = i
        
        # Iterate through the unsorted portion
        # to find the actual minimum
        for j in range(i + 1, n):
            if arr[j] < arr[min_idx]:
              
                # Update min_idx if a smaller element is found
                min_idx = j
        
        # Move minimum element to its
        # correct position
        arr[i], arr[min_idx] = arr[min_idx], arr[i]
18 Oct 2024, 03:43

insertion sort
def insertionSort(arr):
    for i in range(1, len(arr)):
        key = arr[i]
        j = i - 1

        # Move elements of arr[0..i-1], that are
        # greater than key, to one position ahead
        # of their current position
        while j >= 0 and key < arr[j]:
            arr[j + 1] = arr[j]
            j -= 1
        arr[j + 1] = key
18 Oct 2024, 03:42

bubble sort
def bubbleSort(arr):
    n = len(arr)
    
    # Traverse through all array elements
    for i in range(n):
        swapped = False

        # Last i elements are already in place
        for j in range(0, n-i-1):

            # Traverse the array from 0 to n-i-1
            # Swap if the element found is greater
            # than the next element
            if arr[j] > arr[j+1]:
                arr[j], arr[j+1] = arr[j+1], arr[j]
                swapped = True
        if (swapped == False):
            break
18 Oct 2024, 03:42

18 Oct 2024, 03:30