Lädt...

🔧 DSA Journey #day2


Nachrichtenbereich: 🔧 Programmierung
🔗 Quelle: dev.to

So today I’ll solve some basic array questions as follows and I’ll share the code that I have done. Let’s get started on my day 2 journey.

Find the Missing number in the array #1
for this question I have implemented the logic as follows, as it it a very basic and straightforward question.


//122 / 122 testcases passed

/**
 * @param {number[]} nums
 * @return {number}
 */
var missingNumber = function (nums) {
    if (nums.length === 0) return;
    nums = nums.sort((a, b) => a - b)
    for (let i = 0; i <= nums.length; i++) {
        if (nums[i] !== i) {
            return i;
        }
    }
};

Max Consecutive Ones #2 — Leetcode — 485
Given a binary array nums, return the maximum number of consecutive 1's in the array.

/**
 * @param {number[]} nums
 * @return {number}
 */
var findMaxConsecutiveOnes = function (nums) {
    if (nums.length === 0) return;

    let counter = 0;
    let max = 0;

    for (let i = 0; i < nums.length; i++) {
        if (nums[i] === 1) {
            counter++;
            if (counter > max) {
                max = counter
            }
        } else {
            counter = 0
        }
    }
    return max
};

Thanks for visiting
Bidhubhushan Gahan
7609074970

Github - https://github.com/Bidhu1024
LinkedIn - https://www.linkedin.com/in/bidhu05/
Leetcode - https://leetcode.com/u/Bidhubhushan_Gahan/

...

🔧 DSA Journey #day2


📈 40.13 Punkte
🔧 Programmierung

🔧 My Journey Learning Artificial Intelligence -Day2


📈 33.52 Punkte
🔧 Programmierung

🔧 Python List Tutorial Day2


📈 26.16 Punkte
🔧 Programmierung

🔧 Aws zero-to-hero: Day2 A Deep Dive into Implementing AWS WAF for Unrivaled Web Application


📈 26.16 Punkte
🔧 Programmierung

🔧 Day2 java program


📈 26.16 Punkte
🔧 Programmierung

🔧 Day2 java program


📈 26.16 Punkte
🔧 Programmierung

🔧 Day2 java


📈 26.16 Punkte
🔧 Programmierung

🔧 day2 object and class


📈 26.16 Punkte
🔧 Programmierung

🔧 Day2 of 100DaysOfJavaScript


📈 26.16 Punkte
🔧 Programmierung

🔧 Output Day2


📈 26.16 Punkte
🔧 Programmierung

🔧 Python List Tutorial Day2


📈 26.16 Punkte
🔧 Programmierung

🔧 Comparing an IT Department’s DevOps Journey to a Personal Health and Wellness Journey


📈 14.73 Punkte
🔧 Programmierung

🔧 🚀 Starting My DSA Journey: 1 Problem a Day Challenge! 💡🎯


📈 13.97 Punkte
🔧 Programmierung

🔧 DSA's intro to your development journey


📈 13.97 Punkte
🔧 Programmierung

🔧 DSA Journey with Python - Day 1 (Python Array 01)


📈 13.97 Punkte
🔧 Programmierung

🔧 My Tech Journey - Web Dev | DSA | Open Source


📈 13.97 Punkte
🔧 Programmierung

🔧 Starting my DSA journey


📈 13.97 Punkte
🔧 Programmierung

🔧 Share Your Non-CS Journey: Learning DSA - We Want to Hear Your Story


📈 13.97 Punkte
🔧 Programmierung

🔧 My Learning Journey: .NET Core, Angular, and DSA


📈 13.97 Punkte
🔧 Programmierung

🔧 #30DaysofCode September: My journey to DSA Mastery


📈 13.97 Punkte
🔧 Programmierung

🔧 My Journey into Web Development and DSA as a CSE Student


📈 13.97 Punkte
🔧 Programmierung

🔧 Restarting my DSA Journey 🚀


📈 13.97 Punkte
🔧 Programmierung

🔧 Diving Deep into DSA on My Journey to L5-L6! 🚀


📈 13.97 Punkte
🔧 Programmierung

🕵️ Google Go bis 1.5.3/1.6.0 crypto/dsa/dsa.go Verify Denial of Service


📈 13.21 Punkte
🕵️ Sicherheitslücken

🔧 DSA before Development or Development before DSA?


📈 13.21 Punkte
🔧 Programmierung

🕵️ Google Go up to 1.5.3/1.6.0 crypto/dsa/dsa.go Verify denial of service


📈 13.21 Punkte
🕵️ Sicherheitslücken

🕵️ OpenSSL DSA Signing crypto/dsa/dsa_ossl.c Information Disclosure


📈 13.21 Punkte
🕵️ Sicherheitslücken

🕵️ Google Go bis 1.5.3/1.6.0 crypto/dsa/dsa.go Verify Denial of Service


📈 13.21 Punkte
🕵️ Sicherheitslücken

matomo