ru
Feedback

Не попадитесь на канал ботавода! Telemetrio находит и помечает такие каналы 👉 Хотите видеть метку — оформите подписку

Leetcode with dani

Leetcode with dani

Открыть в 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

Больше
1 240
Подписчики
-124 часа
-37 дней
-1730 дней
Архив постов
","datePublished":"2024-08-02T16:07:55Z","dateModified":"2024-08-02T16:08:01Z","author":{"@type":"Organization","name":"Leetcode with dani","url":"https://telemetr.io/ru/channels/1979744670-leetcodeq","image":"https://img.telemetr.io/c/29YO1E/5832277572212345105?ty=x"},"publisher":{"@type":"Organization","name":"Leetcode with dani","url":"https://telemetr.io/ru/channels/1979744670-leetcodeq","image":"https://img.telemetr.io/c/29YO1E/5832277572212345105?ty=x"},"commentCount":0,"interactionStatistic":[{"@type":"InteractionCounter","interactionType":"https://schema.org/ViewAction","userInteractionCount":1}]}},{"@type":"ListItem","position":4,"item":{"@type":"SocialMediaPosting","@id":"https://telemetr.io/ru/channels/1979744670-leetcodeq/posts/590","url":"https://telemetr.io/ru/channels/1979744670-leetcodeq/posts/590","mainEntityOfPage":"https://telemetr.io/ru/channels/1979744670-leetcodeq/posts/590","headline":"please follow me on tiktok 🙏eyejemerku nw ena esti aberetatugn","articleBody":"please follow me on tiktok 🙏eyejemerku nw ena esti aberetatugn","datePublished":"2024-08-02T16:07:51Z","dateModified":"2024-08-05T07:01:48Z","author":{"@type":"Organization","name":"Leetcode with dani","url":"https://telemetr.io/ru/channels/1979744670-leetcodeq","image":"https://img.telemetr.io/c/29YO1E/5832277572212345105?ty=x"},"publisher":{"@type":"Organization","name":"Leetcode with dani","url":"https://telemetr.io/ru/channels/1979744670-leetcodeq","image":"https://img.telemetr.io/c/29YO1E/5832277572212345105?ty=x"},"commentCount":0,"interactionStatistic":[{"@type":"InteractionCounter","interactionType":"https://schema.org/ViewAction","userInteractionCount":114},{"@type":"InteractionCounter","interactionType":"https://schema.org/ShareAction","userInteractionCount":1}]}},{"@type":"ListItem","position":5,"item":{"@type":"SocialMediaPosting","@id":"https://telemetr.io/ru/channels/1979744670-leetcodeq/posts/589","url":"https://telemetr.io/ru/channels/1979744670-leetcodeq/posts/589","mainEntityOfPage":"https://telemetr.io/ru/channels/1979744670-leetcodeq/posts/589","headline":"https://t.me/zprogramming_bot","articleBody":"https://t.me/zprogramming_bot","datePublished":"2024-08-02T12:12:35Z","dateModified":"2024-08-02T12:12:35Z","author":{"@type":"Organization","name":"Leetcode with dani","url":"https://telemetr.io/ru/channels/1979744670-leetcodeq","image":"https://img.telemetr.io/c/29YO1E/5832277572212345105?ty=x"},"publisher":{"@type":"Organization","name":"Leetcode with dani","url":"https://telemetr.io/ru/channels/1979744670-leetcodeq","image":"https://img.telemetr.io/c/29YO1E/5832277572212345105?ty=x"},"commentCount":0,"interactionStatistic":[{"@type":"InteractionCounter","interactionType":"https://schema.org/ViewAction","userInteractionCount":276}]}},{"@type":"ListItem","position":6,"item":{"@type":"SocialMediaPosting","@id":"https://telemetr.io/ru/channels/1979744670-leetcodeq/posts/588","url":"https://telemetr.io/ru/channels/1979744670-leetcodeq/posts/588","mainEntityOfPage":"https://telemetr.io/ru/channels/1979744670-leetcodeq/posts/588","headline":"write your answer in the group or send it with the bot i will review it.","articleBody":"write your answer in the group or send it with the bot i will review it.","datePublished":"2024-08-02T12:12:06Z","dateModified":"2024-08-02T12:12:06Z","author":{"@type":"Organization","name":"Leetcode with dani","url":"https://telemetr.io/ru/channels/1979744670-leetcodeq","image":"https://img.telemetr.io/c/29YO1E/5832277572212345105?ty=x"},"publisher":{"@type":"Organization","name":"Leetcode with dani","url":"https://telemetr.io/ru/channels/1979744670-leetcodeq","image":"https://img.telemetr.io/c/29YO1E/5832277572212345105?ty=x"},"commentCount":0,"interactionStatistic":[{"@type":"InteractionCounter","interactionType":"https://schema.org/ViewAction","userInteractionCount":271}]}},{"@type":"ListItem","position":7,"item":{"@type":"SocialMediaPosting","@id":"https://telemetr.io/ru/channels/1979744670-leetcodeq/posts/587","url":"https://telemetr.io/ru/channels/1979744670-leetcodeq/posts/587","mainEntityOfPage":"https://telemetr.io/ru/channels/1979744670-leetcodeq/posts/587","headline":"Prefix Sum Array – Implementation and Applications in Competitive Programming Given an array arr[] of size N,…","articleBody":"Prefix Sum Array – Implementation and Applications in Competitive Programming\n\nGiven an array arr[] of size N, find the prefix sum of the array. A prefix sum array is another array prefixSum[] of the same size, such that the value of prefixSum[i] is arr[0] + arr[1] + arr[2] . . . arr[i].\n\nExamples: \nInput: arr[] = {10, 20, 10, 5, 15}\nOutput: prefixSum[] = {10, 30, 40, 45, 60}\nExplanation: While traversing the array, update the element by adding it with its previous element.\nprefixSum[0] = 10, \nprefixSum[1] = prefixSum[0] + arr[1] = 30, \nprefixSum[2] = prefixSum[1] + arr[2] = 40 and so on.","datePublished":"2024-08-02T12:10:38Z","dateModified":"2024-08-02T12:10:38Z","author":{"@type":"Organization","name":"Leetcode with dani","url":"https://telemetr.io/ru/channels/1979744670-leetcodeq","image":"https://img.telemetr.io/c/29YO1E/5832277572212345105?ty=x"},"publisher":{"@type":"Organization","name":"Leetcode with dani","url":"https://telemetr.io/ru/channels/1979744670-leetcodeq","image":"https://img.telemetr.io/c/29YO1E/5832277572212345105?ty=x"},"commentCount":0,"interactionStatistic":[{"@type":"InteractionCounter","interactionType":"https://schema.org/ViewAction","userInteractionCount":296},{"@type":"InteractionCounter","interactionType":"https://schema.org/LikeAction","userInteractionCount":2}]}},{"@type":"ListItem","position":8,"item":{"@type":"SocialMediaPosting","@id":"https://telemetr.io/ru/channels/1979744670-leetcodeq/posts/586","url":"https://telemetr.io/ru/channels/1979744670-leetcodeq/posts/586","mainEntityOfPage":"https://telemetr.io/ru/channels/1979744670-leetcodeq/posts/586","headline":"https://youtu.be/7pJo_rM0z_s?si=LXqJNqr9__KNm62s","articleBody":"https://youtu.be/7pJo_rM0z_s?si=LXqJNqr9__KNm62s","datePublished":"2024-08-02T11:29:03Z","dateModified":"2024-08-02T11:29:03Z","author":{"@type":"Organization","name":"Leetcode with dani","url":"https://telemetr.io/ru/channels/1979744670-leetcodeq","image":"https://img.telemetr.io/c/29YO1E/5832277572212345105?ty=x"},"publisher":{"@type":"Organization","name":"Leetcode with dani","url":"https://telemetr.io/ru/channels/1979744670-leetcodeq","image":"https://img.telemetr.io/c/29YO1E/5832277572212345105?ty=x"},"commentCount":0,"interactionStatistic":[{"@type":"InteractionCounter","interactionType":"https://schema.org/ViewAction","userInteractionCount":270}]}},{"@type":"ListItem","position":9,"item":{"@type":"SocialMediaPosting","@id":"https://telemetr.io/ru/channels/1979744670-leetcodeq/posts/584","url":"https://telemetr.io/ru/channels/1979744670-leetcodeq/posts/584","mainEntityOfPage":"https://telemetr.io/ru/channels/1979744670-leetcodeq/posts/584","headline":"Million Dollar Giveaway! Join the Most Exciting Ton Mini App - Farmer's World!Sign up and get 2000 coins to k…","articleBody":"Million Dollar Giveaway! Join the Most Exciting Ton Mini App - Farmer's World!Sign up and get 2000 coins to kickstart your farming journey! USDT Airdrop with amazing rewards waiting for you! Earn Cash by Inviting Friends: Get $0.02 for every friend you successfully invite!\n\nhttps://t.me/farmworlds_bot","datePublished":"2024-08-02T08:26:40Z","dateModified":"2024-08-03T13:43:04Z","author":{"@type":"Organization","name":"Leetcode with dani","url":"https://telemetr.io/ru/channels/1979744670-leetcodeq","image":"https://img.telemetr.io/c/29YO1E/5832277572212345105?ty=x"},"publisher":{"@type":"Organization","name":"Leetcode with dani","url":"https://telemetr.io/ru/channels/1979744670-leetcodeq","image":"https://img.telemetr.io/c/29YO1E/5832277572212345105?ty=x"},"commentCount":0,"interactionStatistic":[{"@type":"InteractionCounter","interactionType":"https://schema.org/ViewAction","userInteractionCount":144},{"@type":"InteractionCounter","interactionType":"https://schema.org/ShareAction","userInteractionCount":2}]}},{"@type":"ListItem","position":10,"item":{"@type":"SocialMediaPosting","@id":"https://telemetr.io/ru/channels/1979744670-leetcodeq/posts/583","url":"https://telemetr.io/ru/channels/1979744670-leetcodeq/posts/583","mainEntityOfPage":"https://telemetr.io/ru/channels/1979744670-leetcodeq/posts/583","headline":"ከመሞት ባተርፋት ሀገሬን ጫኑልኝ ይዣት እጠፋለሁ ልባችሁ ሲረጋ ቀልባችሁ ሲሰክን፣ እምልሳታለሁ።","articleBody":"ከመሞት ባተርፋት\nሀገሬን ጫኑልኝ ይዣት እጠፋለሁ ልባችሁ ሲረጋ\nቀልባችሁ ሲሰክን፣ እምልሳታለሁ።","datePublished":"2024-08-01T18:37:25Z","dateModified":"2024-08-01T18:37:25Z","author":{"@type":"Organization","name":"Leetcode with dani","url":"https://telemetr.io/ru/channels/1979744670-leetcodeq","image":"https://img.telemetr.io/c/29YO1E/5832277572212345105?ty=x"},"publisher":{"@type":"Organization","name":"Leetcode with dani","url":"https://telemetr.io/ru/channels/1979744670-leetcodeq","image":"https://img.telemetr.io/c/29YO1E/5832277572212345105?ty=x"},"commentCount":0,"interactionStatistic":[{"@type":"InteractionCounter","interactionType":"https://schema.org/ViewAction","userInteractionCount":357},{"@type":"InteractionCounter","interactionType":"https://schema.org/LikeAction","userInteractionCount":13},{"@type":"InteractionCounter","interactionType":"https://schema.org/ShareAction","userInteractionCount":1}]}},{"@type":"ListItem","position":11,"item":{"@type":"SocialMediaPosting","@id":"https://telemetr.io/ru/channels/1979744670-leetcodeq/posts/582","url":"https://telemetr.io/ru/channels/1979744670-leetcodeq/posts/582","mainEntityOfPage":"https://telemetr.io/ru/channels/1979744670-leetcodeq/posts/582","headline":"Leetcode with dani","datePublished":"2024-08-01T17:12:15Z","dateModified":"2024-08-01T17:12:15Z","author":{"@type":"Organization","name":"Leetcode with dani","url":"https://telemetr.io/ru/channels/1979744670-leetcodeq","image":"https://img.telemetr.io/c/29YO1E/5832277572212345105?ty=x"},"publisher":{"@type":"Organization","name":"Leetcode with dani","url":"https://telemetr.io/ru/channels/1979744670-leetcodeq","image":"https://img.telemetr.io/c/29YO1E/5832277572212345105?ty=x"},"commentCount":0,"interactionStatistic":[{"@type":"InteractionCounter","interactionType":"https://schema.org/ViewAction","userInteractionCount":325}]}},{"@type":"ListItem","position":12,"item":{"@type":"SocialMediaPosting","@id":"https://telemetr.io/ru/channels/1979744670-leetcodeq/posts/581","url":"https://telemetr.io/ru/channels/1979744670-leetcodeq/posts/581","mainEntityOfPage":"https://telemetr.io/ru/channels/1979744670-leetcodeq/posts/581","headline":"Leetcode with dani","datePublished":"2024-08-01T17:11:29Z","dateModified":"2024-08-01T17:11:46Z","author":{"@type":"Organization","name":"Leetcode with dani","url":"https://telemetr.io/ru/channels/1979744670-leetcodeq","image":"https://img.telemetr.io/c/29YO1E/5832277572212345105?ty=x"},"publisher":{"@type":"Organization","name":"Leetcode with dani","url":"https://telemetr.io/ru/channels/1979744670-leetcodeq","image":"https://img.telemetr.io/c/29YO1E/5832277572212345105?ty=x"},"commentCount":0,"interactionStatistic":[{"@type":"InteractionCounter","interactionType":"https://schema.org/ViewAction","userInteractionCount":1}]}},{"@type":"ListItem","position":13,"item":{"@type":"SocialMediaPosting","@id":"https://telemetr.io/ru/channels/1979744670-leetcodeq/posts/580","url":"https://telemetr.io/ru/channels/1979744670-leetcodeq/posts/580","mainEntityOfPage":"https://telemetr.io/ru/channels/1979744670-leetcodeq/posts/580","headline":"The behavior difference between mutable objects (like lists) and immutable objects (like integers) in Python…","articleBody":"The behavior difference between mutable objects (like lists) and immutable objects (like integers) in Python explains why changing the value of a variable affects another variable when dealing with arrays (lists) but not when dealing with integers.\n\nMutable vs. Immutable Objects\nMutable objects: These can be changed in place. Examples include lists, dictionaries, and sets.\nImmutable objects: These cannot be changed in place. Examples include integers, strings, and tuples.\nImmutable Example (Integers)\nWhen you assign an integer to another variable, Python creates a new reference to the integer object. Since integers are immutable, changing the value of one variable does not affect the other.\na = 10\nb = a # b now references the same integer object as a\nb = 20 # b now references a new integer object\nprint(a) # output: 10\nprint(b) # output: 20\nIn this example, when b is assigned the value 20, it does not change the value of a because integers are immutable. Assigning 20 to b makes b reference a new integer object.\n\nMutable Example (Lists)\nWhen you assign a list to another variable, both variables reference the same list object. Since lists are mutable, changes made through one variable are reflected in the other.\n\na = [1, 2, 3]\nb = a # b now references the same list as a\nb[0] = 99 # modify the first element of the list referenced by b\nprint(a) # output: [99, 2, 3]\nprint(b) # output: [99, 2, 3]\nIn this example, both a and b reference the same list object. Changing the list through b affects the list referenced by a because lists are mutable.\n\nWhy This Happens\nImmutable objects: Variables referencing immutable objects (like integers) create a new reference when reassigned.\nMutable objects: Variables referencing mutable objects (like lists) point to the same object unless explicitly copied.","datePublished":"2024-07-31T17:25:34Z","dateModified":"2024-07-31T17:25:34Z","author":{"@type":"Organization","name":"Leetcode with dani","url":"https://telemetr.io/ru/channels/1979744670-leetcodeq","image":"https://img.telemetr.io/c/29YO1E/5832277572212345105?ty=x"},"publisher":{"@type":"Organization","name":"Leetcode with dani","url":"https://telemetr.io/ru/channels/1979744670-leetcodeq","image":"https://img.telemetr.io/c/29YO1E/5832277572212345105?ty=x"},"commentCount":0,"interactionStatistic":[{"@type":"InteractionCounter","interactionType":"https://schema.org/ViewAction","userInteractionCount":369},{"@type":"InteractionCounter","interactionType":"https://schema.org/LikeAction","userInteractionCount":4},{"@type":"InteractionCounter","interactionType":"https://schema.org/ShareAction","userInteractionCount":1}]}},{"@type":"ListItem","position":14,"item":{"@type":"SocialMediaPosting","@id":"https://telemetr.io/ru/channels/1979744670-leetcodeq/posts/579","url":"https://telemetr.io/ru/channels/1979744670-leetcodeq/posts/579","mainEntityOfPage":"https://telemetr.io/ru/channels/1979744670-leetcodeq/posts/579","headline":"Leetcode with dani","datePublished":"2024-07-31T07:34:13Z","dateModified":"2024-07-31T07:34:13Z","author":{"@type":"Organization","name":"Leetcode with dani","url":"https://telemetr.io/ru/channels/1979744670-leetcodeq","image":"https://img.telemetr.io/c/29YO1E/5832277572212345105?ty=x"},"publisher":{"@type":"Organization","name":"Leetcode with dani","url":"https://telemetr.io/ru/channels/1979744670-leetcodeq","image":"https://img.telemetr.io/c/29YO1E/5832277572212345105?ty=x"},"commentCount":2,"interactionStatistic":[{"@type":"InteractionCounter","interactionType":"https://schema.org/ViewAction","userInteractionCount":288},{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2}]}},{"@type":"ListItem","position":15,"item":{"@type":"SocialMediaPosting","@id":"https://telemetr.io/ru/channels/1979744670-leetcodeq/posts/578","url":"https://telemetr.io/ru/channels/1979744670-leetcodeq/posts/578","mainEntityOfPage":"https://telemetr.io/ru/channels/1979744670-leetcodeq/posts/578","headline":"Leetcode with dani","datePublished":"2024-07-31T07:32:02Z","dateModified":"2024-07-31T07:32:02Z","author":{"@type":"Organization","name":"Leetcode with dani","url":"https://telemetr.io/ru/channels/1979744670-leetcodeq","image":"https://img.telemetr.io/c/29YO1E/5832277572212345105?ty=x"},"publisher":{"@type":"Organization","name":"Leetcode with dani","url":"https://telemetr.io/ru/channels/1979744670-leetcodeq","image":"https://img.telemetr.io/c/29YO1E/5832277572212345105?ty=x"},"commentCount":0,"interactionStatistic":[{"@type":"InteractionCounter","interactionType":"https://schema.org/ViewAction","userInteractionCount":314}]}},{"@type":"ListItem","position":16,"item":{"@type":"SocialMediaPosting","@id":"https://telemetr.io/ru/channels/1979744670-leetcodeq/posts/577","url":"https://telemetr.io/ru/channels/1979744670-leetcodeq/posts/577","mainEntityOfPage":"https://telemetr.io/ru/channels/1979744670-leetcodeq/posts/577","headline":"Leetcode with dani","datePublished":"2024-07-30T18:08:16Z","dateModified":"2024-07-30T18:08:16Z","author":{"@type":"Organization","name":"Leetcode with dani","url":"https://telemetr.io/ru/channels/1979744670-leetcodeq","image":"https://img.telemetr.io/c/29YO1E/5832277572212345105?ty=x"},"publisher":{"@type":"Organization","name":"Leetcode with dani","url":"https://telemetr.io/ru/channels/1979744670-leetcodeq","image":"https://img.telemetr.io/c/29YO1E/5832277572212345105?ty=x"},"commentCount":0,"interactionStatistic":[{"@type":"InteractionCounter","interactionType":"https://schema.org/ViewAction","userInteractionCount":329},{"@type":"InteractionCounter","interactionType":"https://schema.org/LikeAction","userInteractionCount":6},{"@type":"InteractionCounter","interactionType":"https://schema.org/ShareAction","userInteractionCount":2}]}},{"@type":"ListItem","position":17,"item":{"@type":"SocialMediaPosting","@id":"https://telemetr.io/ru/channels/1979744670-leetcodeq/posts/576","url":"https://telemetr.io/ru/channels/1979744670-leetcodeq/posts/576","mainEntityOfPage":"https://telemetr.io/ru/channels/1979744670-leetcodeq/posts/576","headline":"Leetcode with dani","datePublished":"2024-07-30T18:07:23Z","dateModified":"2024-07-30T18:07:31Z","author":{"@type":"Organization","name":"Leetcode with dani","url":"https://telemetr.io/ru/channels/1979744670-leetcodeq","image":"https://img.telemetr.io/c/29YO1E/5832277572212345105?ty=x"},"publisher":{"@type":"Organization","name":"Leetcode with dani","url":"https://telemetr.io/ru/channels/1979744670-leetcodeq","image":"https://img.telemetr.io/c/29YO1E/5832277572212345105?ty=x"},"commentCount":0,"interactionStatistic":[{"@type":"InteractionCounter","interactionType":"https://schema.org/ViewAction","userInteractionCount":2}]}},{"@type":"ListItem","position":18,"item":{"@type":"SocialMediaPosting","@id":"https://telemetr.io/ru/channels/1979744670-leetcodeq/posts/575","url":"https://telemetr.io/ru/channels/1979744670-leetcodeq/posts/575","mainEntityOfPage":"https://telemetr.io/ru/channels/1979744670-leetcodeq/posts/575","headline":"Leetcode with dani","datePublished":"2024-07-30T18:04:51Z","dateModified":"2024-07-30T18:04:51Z","author":{"@type":"Organization","name":"Leetcode with dani","url":"https://telemetr.io/ru/channels/1979744670-leetcodeq","image":"https://img.telemetr.io/c/29YO1E/5832277572212345105?ty=x"},"publisher":{"@type":"Organization","name":"Leetcode with dani","url":"https://telemetr.io/ru/channels/1979744670-leetcodeq","image":"https://img.telemetr.io/c/29YO1E/5832277572212345105?ty=x"},"commentCount":0,"interactionStatistic":[{"@type":"InteractionCounter","interactionType":"https://schema.org/ViewAction","userInteractionCount":293}]}},{"@type":"ListItem","position":19,"item":{"@type":"SocialMediaPosting","@id":"https://telemetr.io/ru/channels/1979744670-leetcodeq/posts/574","url":"https://telemetr.io/ru/channels/1979744670-leetcodeq/posts/574","mainEntityOfPage":"https://telemetr.io/ru/channels/1979744670-leetcodeq/posts/574","headline":"Solution Code: python Copy code from typing import List class Solution: def minSubArrayLen(self, target: int,…","articleBody":"Solution Code:\npython\nCopy code\nfrom typing import List\n\nclass Solution:\n def minSubArrayLen(self, target: int, nums: List[int]) -> int:\n minm = len(nums) + 1\n left = 0\n tot = 0\n \n for i in range(len(nums)):\n tot += nums[i]\n while tot >= target:\n minm = min(minm, i - left + 1)\n tot -= nums[left]\n left += 1\n \n if minm > len(nums):\n return 0\n return minm\nExplanation:\nInitialize Variables:\n\nminm is initialized to a value greater than the length of nums to ensure any valid subarray length found will be smaller.\nleft is the starting index of the current subarray.\ntot is the sum of the current subarray.\nIterate Through nums:\n\nAdd each element to tot as we iterate through the array with index i.\nAdjust left Pointer:\n\nIf tot is greater than or equal to target, adjust the left pointer to find the minimal subarray length.\nContinuously subtract the value at nums[left] from tot and increment left until tot is less than target.\nDuring this process, update minm with the length of the current valid subarray if it's smaller than the previously recorded minm.\nReturn Result:\n\nIf no valid subarray is found, minm will remain greater than len(nums) and the function will return 0.\nOtherwise, it returns the minimal length of the subarray.\nThis approach ensures an efficient solution with a time complexity of O(n), where n is the length of the input array nums. The sliding window technique optimally finds the minimal subarray length in a single pass through the array.","datePublished":"2024-07-30T13:56:23Z","dateModified":"2024-07-30T13:56:23Z","author":{"@type":"Organization","name":"Leetcode with dani","url":"https://telemetr.io/ru/channels/1979744670-leetcodeq","image":"https://img.telemetr.io/c/29YO1E/5832277572212345105?ty=x"},"publisher":{"@type":"Organization","name":"Leetcode with dani","url":"https://telemetr.io/ru/channels/1979744670-leetcodeq","image":"https://img.telemetr.io/c/29YO1E/5832277572212345105?ty=x"},"commentCount":0,"interactionStatistic":[{"@type":"InteractionCounter","interactionType":"https://schema.org/ViewAction","userInteractionCount":315},{"@type":"InteractionCounter","interactionType":"https://schema.org/LikeAction","userInteractionCount":4}]}},{"@type":"ListItem","position":20,"item":{"@type":"SocialMediaPosting","@id":"https://telemetr.io/ru/channels/1979744670-leetcodeq/posts/573","url":"https://telemetr.io/ru/channels/1979744670-leetcodeq/posts/573","mainEntityOfPage":"https://telemetr.io/ru/channels/1979744670-leetcodeq/posts/573","headline":"You are in a room with three light switches. Each switch controls one of three light bulbs in an adjacent roo…","articleBody":"You are in a room with three light switches. Each switch controls one of three light bulbs in an adjacent room, but you do not know which switch controls which bulb. You can only go into the adjacent room once to check the state of the bulbs. How can you determine which switch controls which bulb?","datePublished":"2024-07-30T08:11:05Z","dateModified":"2024-07-30T08:11:05Z","author":{"@type":"Organization","name":"Leetcode with dani","url":"https://telemetr.io/ru/channels/1979744670-leetcodeq","image":"https://img.telemetr.io/c/29YO1E/5832277572212345105?ty=x"},"publisher":{"@type":"Organization","name":"Leetcode with dani","url":"https://telemetr.io/ru/channels/1979744670-leetcodeq","image":"https://img.telemetr.io/c/29YO1E/5832277572212345105?ty=x"},"commentCount":4,"interactionStatistic":[{"@type":"InteractionCounter","interactionType":"https://schema.org/ViewAction","userInteractionCount":261},{"@type":"InteractionCounter","interactionType":"https://schema.org/LikeAction","userInteractionCount":5},{"@type":"InteractionCounter","interactionType":"https://schema.org/ShareAction","userInteractionCount":1},{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4}]}}]}
Answer:
def prefix_sum(arr):
    prefix_sum_arr = [0] * len(arr)
    prefix_sum_arr[0] = arr[0]
    for i in range(1, len(arr)):
        prefix_sum_arr[i] = prefix_sum_arr[i - 1] + arr[i]
    return prefix_sum_arr

arr = [10, 20, 10, 5, 15]
result = prefix_sum(arr)
print(result)  # Output: [10, 30, 40, 45, 60]
03 авг. 2024, 01:25

02 авг. 2024, 12:08
05 авг. 2024, ~03:01

<blockquote class="tiktok-embed" cite="https://www.tiktok.com/@b_edit12" data-unique-id="b_edit12" data-embed-type="creator" style="max-width: 780px; min-width: 288px;" > <section> <a target="_blank" href="https://www.tiktok.com/@b_edit12?refer=creator_embed">@b_edit12</a> </section> </blockquote> <script async src="https://www.tiktok.com/embed.js"></script>
02 авг. 2024, 12:07
02 авг. 2024, ~12:08

please follow me on tiktok 🙏eyejemerku nw ena esti aberetatugn
02 авг. 2024, 12:07
05 авг. 2024, ~03:01

02 авг. 2024, 08:12

write your answer in the group or send it with the bot i will review it.
02 авг. 2024, 08:12

Prefix Sum Array – Implementation and Applications in Competitive Programming Given an array arr[] of size N, find the prefix sum of the array. A prefix sum array is another array prefixSum[] of the same size, such that the value of prefixSum[i] is arr[0] + arr[1] + arr[2] . . . arr[i]. Examples: Input: arr[] = {10, 20, 10, 5, 15} Output: prefixSum[] = {10, 30, 40, 45, 60} Explanation: While traversing the array, update the element by adding it with its previous element. prefixSum[0] = 10, prefixSum[1] = prefixSum[0] + arr[1] = 30, prefixSum[2] = prefixSum[1] + arr[2] = 40 and so on.
02 авг. 2024, 08:10

02 авг. 2024, 07:29

Million Dollar Giveaway! Join the Most Exciting Ton Mini App - Farmer's World!Sign up and get 2000 coins to kickstart your fa
Million Dollar Giveaway! Join the Most Exciting Ton Mini App - Farmer's World!Sign up and get 2000 coins to kickstart your farming journey! USDT Airdrop with amazing rewards waiting for you! Earn Cash by Inviting Friends: Get $0.02 for every friend you successfully invite! https://t.me/farmworlds_bot
02 авг. 2024, 04:26
03 авг. 2024, ~09:43

ከመሞት ባተርፋት ሀገሬን ጫኑልኝ ይዣት እጠፋለሁ ልባችሁ ሲረጋ ቀልባችሁ ሲሰክን፣ እምልሳታለሁ።
ከመሞት ባተርፋት ሀገሬን ጫኑልኝ ይዣት እጠፋለሁ ልባችሁ ሲረጋ ቀልባችሁ ሲሰክን፣ እምልሳታለሁ።
01 авг. 2024, 14:37

are you familiar with the prefix sum algorithm?
Anonymous voting
01 авг. 2024, 13:12

are of you are familiar with the prefix sum algorithm?
Anonymous voting
01 авг. 2024, 13:11
01 авг. 2024, ~13:11

The behavior difference between mutable objects (like lists) and immutable objects (like integers) in Python explains why changing the value of a variable affects another variable when dealing with arrays (lists) but not when dealing with integers. Mutable vs. Immutable Objects Mutable objects: These can be changed in place. Examples include lists, dictionaries, and sets. Immutable objects: These cannot be changed in place. Examples include integers, strings, and tuples. Immutable Example (Integers) When you assign an integer to another variable, Python creates a new reference to the integer object. Since integers are immutable, changing the value of one variable does not affect the other.
a = 10
b = a  # b now references the same integer object as a
b = 20  # b now references a new integer object
print(a)  # output: 10
print(b)  # output: 20
In this example, when b is assigned the value 20, it does not change the value of a because integers are immutable. Assigning 20 to b makes b reference a new integer object. Mutable Example (Lists) When you assign a list to another variable, both variables reference the same list object. Since lists are mutable, changes made through one variable are reflected in the other.
a = [1, 2, 3]
b = a  # b now references the same list as a
b[0] = 99  # modify the first element of the list referenced by b
print(a)  # output: [99, 2, 3]
print(b)  # output: [99, 2, 3]
In this example, both a and b reference the same list object. Changing the list through b affects the list referenced by a because lists are mutable. Why This Happens Immutable objects: Variables referencing immutable objects (like integers) create a new reference when reassigned. Mutable objects: Variables referencing mutable objects (like lists) point to the same object unless explicitly copied.
31 июля 2024, 13:25

x = [2] y = x y = 3 print(y,x)
Anonymous voting
31 июля 2024, 03:34

x = 5 y = [x,x] y[0] = 10 print(y)
Anonymous voting
31 июля 2024, 03:32

What is the output of the following code? x = [1, 2, 3] y = [x, x, x] y[0][0] = 10 print(y)
Anonymous voting
30 июля 2024, 14:08

What is the output of the following code? x = [1, 2, 3] y = [x, x, x] y[0][0] = 10 print(y)
Anonymous voting
30 июля 2024, 14:07
30 июля 2024, ~14:07

What is the purpose of the `super()` function in Python?
Anonymous voting
30 июля 2024, 14:04

Solution Code: python Copy code from typing import List class Solution: def minSubArrayLen(self, target: int, nums: List[int]) -> int: minm = len(nums) + 1 left = 0 tot = 0 for i in range(len(nums)): tot += nums[i] while tot >= target: minm = min(minm, i - left + 1) tot -= nums[left] left += 1 if minm > len(nums): return 0 return minm Explanation: Initialize Variables: minm is initialized to a value greater than the length of nums to ensure any valid subarray length found will be smaller. left is the starting index of the current subarray. tot is the sum of the current subarray. Iterate Through nums: Add each element to tot as we iterate through the array with index i. Adjust left Pointer: If tot is greater than or equal to target, adjust the left pointer to find the minimal subarray length. Continuously subtract the value at nums[left] from tot and increment left until tot is less than target. During this process, update minm with the length of the current valid subarray if it's smaller than the previously recorded minm. Return Result: If no valid subarray is found, minm will remain greater than len(nums) and the function will return 0. Otherwise, it returns the minimal length of the subarray. This approach ensures an efficient solution with a time complexity of O(n), where n is the length of the input array nums. The sliding window technique optimally finds the minimal subarray length in a single pass through the array.
30 июля 2024, 09:56

You are in a room with three light switches. Each switch controls one of three light bulbs in an adjacent room, but you do not know which switch controls which bulb. You can only go into the adjacent room once to check the state of the bulbs. How can you determine which switch controls which bulb?
30 июля 2024, 04:11