Subarray range with given sum | GeeksForGeeks | Problem of the Day

  Рет қаралды 157

Mathematics

Mathematics

Күн бұрын

Пікірлер: 4
@mathematics3398
@mathematics3398 5 күн бұрын
Table of Contents 0:00 Problem Statement 0:29 Solution 7:51 Pseudo Code 9:36 Code - Python 10:18 Code - C++
@mathematics3398
@mathematics3398 5 күн бұрын
class Solution { public: // Function to count the number of subarrays which adds to the given sum. int subArraySum(vector& arr, int tar) { map mp; mp[0] = 1; int sum = 0, ans = 0; for (const auto i: arr) { sum += i; //cout
@mathematics3398
@mathematics3398 5 күн бұрын
class Solution: #Complete this fuction #Function to count the number of subarrays which adds to the given sum. def subArraySum(self,arr, tar): mp = dict() s = ans = 0 mp[0] = 1 for element in arr: s += element if s - tar in mp: ans += mp[s-tar] if s in mp: mp[s] += 1 else: mp[s] = 1 return ans
@mr.k4450
@mr.k4450 5 күн бұрын
Hey bud, if you dont mind can i get to know your LEETCODE and GFG handles, also want to know if you do CP and stuff?
Nearest multiple of 10 | GeeksForGeeks | Problem of the Day
13:46
Subarray Range With Given Sum | GFG POTD | Hash Map | C++
17:59
А что бы ты сделал? @LimbLossBoss
00:17
История одного вокалиста
Рет қаралды 10 МЛН
Это было очень близко...
00:10
Аришнев
Рет қаралды 5 МЛН
Миллионер | 1 - серия
34:31
Million Show
Рет қаралды 3 МЛН
Two Swaps | GeeksForGeeks | Problem of the Day
13:37
Mathematics
Рет қаралды 163
ARRAYLIST VS LINKEDLIST
21:20
Core Dumped
Рет қаралды 68 М.
you will never ask about pointers again after watching this video
8:03
Fast Inverse Square Root - A Quake III Algorithm
20:08
Nemean
Рет қаралды 5 МЛН
XOR Linked List | GeeksForGeeks | Problem of the Day
9:21
Mathematics
Рет қаралды 237
Majority Vote | GeeksForGeeks | Problem of the Day
13:22
Mathematics
Рет қаралды 82