Leetcode 523. Continuous Subarray Sum | Coding Decoded SDE Sheet

Here is the solution to "Continuous Subarray Sum" leetcode question. Hope you have a great time going through it.
🎉Question: leetcode.com/problems/continu...
🔴 Connect with me here:
🔅My Linkedin(Sunchit Dudeja): bit.ly/3Qnk0L0
🔅Linkedin: bit.ly/3n65udU
🔅Don't click: bit.ly/32XIXbU
🔅Insta: bit.ly/31TV5ur
🔅 Twitter: / sunchitdudeja
🔅Telegram Link for Chrome: telegram.me/codingdecoded
🔅Telegram Link for phone : t.me/codingdecoded
------------------------------------------------------------------------------------------------------------------------------------------------
Success Stories/Placement Diaries: • Playlist
------------------------------------------------------------------------------------------------------------------------------------------------
Master Data Structures and algorithms 🔽🔽🔽🔽
🔴 Coding Decoded SDE revision Sheet: bit.ly/3MG7d4D
🔥 Coding Decoded Binary Search TreeMap revision Sheet: bit.ly/3kUsiMa
🔥 Coding Decoded Trie revision Sheet: bit.ly/392YOJH
🔥 Coding Decoded Graph SDE sheet: bit.ly/3sfp8H4
🔥 Coding Decoded Stacks/Monotonic Stacks sheet: bit.ly/38tm0Ri
🔥 Coding Decoded Bit Manipulation sheet:bit.ly/3LkVNSe
🔥 Coding Decoded Backtracking SDE sheet: bit.ly/3FCzMwQ
🔥 Coding Decoded DP SDE sheet: bit.ly/38HgY3E
🔥 Coding Decoded Heaps SDE Sheet: bit.ly/3GQqBK7
🔥 Coding Decoded Maps/Sets SDE Sheet: bit.ly/3xfBemu
🔥 Coding Decoded Two Pointer SDE Sheet: bit.ly/3trJCwX
👉 Solution : github.com/Sunchit/Coding-Dec...
🔥🔥🔥🔥👇👇👇 For discussion/feedback/humour/doubts/new openings
Feel free to join discord / discord
🔴 Checkout the series:
👉 Leetcode Interview experiences and tips : • Playlist
👉 Leetcode contests: www.youtube.com?list=PLEI-q7w3s9gRwAEYzYkvVTsYHDi2-ffdL
👉 Leetcode System Design: • System Design
👉 Leetcode LinkedList: • Coding Decoded LinkedL...
👉 Leetcode Stack: • Coding Decoded Stack S...
👉 Leetcode Binary Search: • Coding Decoded BinaryS...
👉 Leetcode Tree: • Coding Decoded Tree Se...
👉 Leetcode Dyanmic Programming: • Coding Decoded Dynamic...
👉 Leetcode Hard: • LeetCode Hard Problems
👉 Leetcode Heap: • Coding Decoded Heap Se...
👉 Building Coding Aptitude: • Building Coding Aptitude
👉 Leetcode Map: • Coding Decoded Map Ser...
👉 Leetcode Two Pointer: • Coding Decoded Two Poi...
👉 Leetcode Backtracking: • Leetcode Backtracking ...
👉 Leetcode Graph Traversal: • Coding Decoded Graph T...
👉 Leetcode Trie: • Coding Decoded Trie Se...
👉 Leetcode Union Find: • Coding Decoded Union F...
👉 Leetcode BFS Graph Problems: • Coding Decoded BFS Ser...
👉 Leetcode Matrix Problems: • Coding Decoded Matrix ...
👉 Leetcode Easy: • Leetcode Easy Problems
👉 Leetcode Bit Manipulation: • Coding Decoded Bit Man...
✨ Hashtags ✨
#CodingDecoded #ProductBased #SoftwareEngineering #FAANGM #FAANG #NSIT #NSUT #engineering #internship #college #Freshers #amazon #apple #coding #algorithms #programming #LearnCoding​ #CodingPractice #leetcode #college #Jee #engineering #leetcode #UseLeetcodeEffectively #dailychallenge
#CareerSwami #Freshers #lifeatmicrosoft #microsoft #softwareengineering #lifeatoci #ocicompensation #ocisalary #softwareengineeringexperience
#dsa #coding #gate #coding #jeemains #iit #jeemains2022 #inspiration #india #firstvlog #motivation
#dsa #datastructure #dsapatterns #google #amazon #amazonsde #softwareengineering #codinginterview #codinginterviewquestions #binarysearch
#microfrontends #frontenddeveloper #softwareengineer
#recession #layoffs #SoftwareIndustry

Пікірлер: 9

  • @krateskim4169
    @krateskim4169 Жыл бұрын

    Awesome explanation Thank you

  • @herculean6748
    @herculean6748 Жыл бұрын

    Why your are not uploading videos? What happened?

  • @EC_ShailendraTrivedi
    @EC_ShailendraTrivedi Жыл бұрын

    Bro if Constraints: 1

  • @phardugaming1215
    @phardugaming1215 Жыл бұрын

    Plse tell that how did you managed to change light to dark theme in leetcode panel

  • @gauravpatil07

    @gauravpatil07

    Жыл бұрын

    yes this is always headache for me

  • @SK-vs9ry

    @SK-vs9ry

    Жыл бұрын

    Click on your profile option (the one beside the Streak counter) on the menu and switch on the Dark Mode over there to get the darker theme across the entire page Note that this works only in case of the new Leetcode version In the old Leetcode version, we can change only the coding area's theme by clicking on the "Editor Settings" option which is shown below the Streak counter and over there we can select whichever theme we want.

  • @ishagupta6671
    @ishagupta6671 Жыл бұрын

    why did you take m[0] = -1?

  • @Codebreaker0702

    @Codebreaker0702

    Жыл бұрын

    did u got it?

  • @shubamgoswami
    @shubamgoswami Жыл бұрын

    MORE EASY WAY class Solution { public boolean checkSubarraySum(int[] arr, int k) { int n = arr.length; // remainder, index // agr koi remainder vapas repeat hua toh vo vapas iska matlab beech //vale numbers divisible h k sa HashMap hm = new HashMap(); hm.put(0,-1); // agr shuru k 2 he k sa divisible hogye prefix sum pa he toh // zero hashmap m mil jaye and -1 isliye ke agr phla element divisible hua k sa // toh ans na return karde we need minimum 2 elements int prefixSum = 0; for(int i = 0 ; i prefixSum += arr[i]; int key = prefixSum%k; if(hm.containsKey(key)){ if(i - hm.get(key) >= 2) return true; }else hm.put(key,i); } return false; } }