cookie

We use cookies to improve your browsing experience. By clicking «Accept all», you agree to the use of cookies.

avatar

Leetcode with dani

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
Advertising posts
1 075
Subscribers
No data24 hours
-47 days
+230 days

Data loading in progress...

Subscriber growth rate

Data loading in progress...

https://t.me/catizenbot/gameapp?startapp=rp_29599749 kezih befit dogs airdrop recommended argiyachu nebr yeheme ke 11 ken beuala list yderegal silver derega deresu
Show all...
Catizen

👏Welcome to the catizens universe! 🐱Upgrade your cats, earn more coins, boost your ranking, and get more airdrop rewards! 🎁Play-to-earn airdrop right now!

👍 2
🚀 Explore Palindrome Challenges with the Two-Pointer Technique!🧑‍💻 Palindromes are a classic problem type that can be efficiently tackled using the two-pointer technique. Whether you're just starting or looking to refine your skills, these questions will help you master this approach. Check out these palindrome problems: 1.Valid Palindrome 🔗 [Link](https://leetcode.com/problems/valid-palindrome/) Description: Determine if a string is a palindrome, considering only alphanumeric characters and ignoring cases. 2. Valid Palindrome II 🔗 [Link](https://leetcode.com/problems/valid-palindrome-ii/) Description: Can the string become a palindrome by deleting just one character? 3. Palindrome Linked List 🔗 [Link](https://leetcode.com/problems/palindrome-linked-list/) Description: Check if a singly linked list is a palindrome using two pointers and a bit of list manipulation. 4. Longest Palindromic Substring 🔗 [Link](https://leetcode.com/problems/longest-palindromic-substring/) Description: Find the longest palindromic substring in a given string, with pointers expanding from each character. 5. Palindromic Substrings 🔗 [Link](https://leetcode.com/problems/palindromic-substrings/) Description: Count how many palindromic substrings are present in the string using two pointers. 6. Shortest Palindrome. 🔗 [Link](https://leetcode.com/problems/shortest-palindrome/) Description: Find the shortest palindrome by adding characters to the start of the string. 7. Palindrome Partitioning 🔗 [Link](https://leetcode.com/problems/palindrome-partitioning/) Description: Partition a string into all possible palindromic substrings. 8. Palindrome Pairs 🔗 [Link](https://leetcode.com/problems/palindrome-pairs/) Description: Given a list of words, find all pairs of distinct indices that form palindromes. Ready to boost your problem-solving skills? Dive into these problems, practice your two-pointer technique, and ace those palindrome challenges! 💥 Happy Coding! 💻💡
Show all...
Valid Palindrome - LeetCode

Can you solve this real interview question? Valid Palindrome - A phrase is a palindrome if, after converting all uppercase letters into lowercase letters and removing all non-alphanumeric characters, it reads the same forward and backward. Alphanumeric characters include letters and numbers. Given a string s, return true if it is a palindrome, or false otherwise.   Example 1: Input: s = "A man, a plan, a canal: Panama" Output: true Explanation: "amanaplanacanalpanama" is a palindrome. Example 2: Input: s = "race a car" Output: false Explanation: "raceacar" is not a palindrome. Example 3: Input: s = " " Output: true Explanation: s is an empty string "" after removing non-alphanumeric characters. Since an empty string reads the same forward and backward, it is a palindrome.   Constraints: * 1 <= s.length <= 2 * 105 * s consists only of printable ASCII characters.

👍 2
▎1. 3Sum def threeSum(nums):     nums.sort()     result = []     for i in range(len(nums) - 2):         if i > 0 and nums[i] == nums[i - 1]:             continue         left, right = i + 1, len(nums) - 1         while left < right:             total = nums[i] + nums[left] + nums[right]             if total < 0:                 left += 1             elif total > 0:                 right -= 1             else:                 result.append([nums[i], nums[left], nums[right]])                 while left < right and nums[left] == nums[left + 1]:                     left += 1                 while left < right and nums[right] == nums[right - 1]:                     right -= 1                 left += 1                 right -= 1     return result ▎2. Minimum Window Substring from collections import Counter def minWindow(s, t):     if not t or not s:         return ""         dict_t = Counter(t)     required = len(dict_t)         l, r = 0, 0     formed = 0     window_counts = {}         ans = float("inf"), None, None         while r < len(s):         character = s[r]         window_counts[character] = window_counts.get(character, 0) + 1                 if character in dict_t and window_counts[character] == dict_t[character]:             formed += 1                 while l <= r and formed == required:             character = s[l]                         if r - l + 1 < ans[0]:                 ans = (r - l + 1, l, r)                         window_counts[character] -= 1             if character in dict_t and window_counts[character] < dict_t[character]:                 formed -= 1                         l += 1                 r += 1         return "" if ans[0] == float("inf") else s[ans[1]: ans[2] + 1] ▎3. Fruit Into Baskets def totalFruits(fruits):     left, right = 0, 0     basket = {}     max_fruits = 0         while right < len(fruits):         basket[fruits[right]] = basket.get(fruits[right], 0) + 1                 while len(basket) > 2:             basket[fruits[left]] -= 1             if basket[fruits[left]] == 0:                 del basket[fruits[left]]             left += 1                 max_fruits = max(max_fruits, right - left + 1)         right += 1         return max_fruits
Show all...
👍 7
1. 3Sum (Hard)     Answer: The solution involves sorting the array and using a two-pointer technique to find triplets that sum to zero. The time complexity is O(n^2). 2. Minimum Window Substring (Hard)     Answer: Use a sliding window approach to maintain a count of characters and expand/shrink the window until the minimum substring is found. The time complexity is O(n). 3. Fruit Into Baskets (Easy)     Answer: Utilize a sliding window to track the types of fruits and their counts, ensuring you only have two types at any time. The maximum length of the window gives the answer. The time complexity is O(n).
Show all...
here are a list of airdrops that may have good reward checks it our!! CATS BLUM BLUM MAJOR FINTOP DUCK SEED AGENT301
Show all...
👍 6
here are a list of airdrops that may have good reward checks it our!! CATS BLUM BLUM MAJOR FINTOP DUCK SEED AGENT301
Show all...
here are a list of airdrops that may have good reward checks it our!! CATS BLUM BLUM MAJOR FINTOP DUCK SEED AGENT301
Show all...
here are good airdrops may have good rewards check it out CATS BLUM BLUM FINTOP DUCK SEED AGENT301
Show all...
Photo unavailableShow in Telegram
Understanding the constraints, time complexity is key to solving LeetCode problems effectively. If you find these concepts confusing, don’t worry , you’re not alone!. this might help you to undestand the constraints
Show all...
👍 5 1
3. Fruit Into Baskets (Easy) Description: You are visiting a farm and have a basket that can hold at most two types of fruits. You want to maximize the number of fruits you collect. Given an array of integers representing the types of fruits in a row, find the maximum number of fruits you can collect in one basket. - Example: For input [1,2,1], the maximum number of fruits collected is 3.
Show all...
Choose a Different Plan

Your current plan allows analytics for only 5 channels. To get more, please choose a different plan.