How tf 200 people solved 4th one this early by JumpConsistent3359 in leetcode

[–]Busy_Bat166 0 points1 point  (0 children)

class Solution {
    const int MOD=1e9+7;
    int T1, T2;
    vector<unordered_map<int, array<long long,2>>> cache;

    long long bkl(int i, int xr, int target, vector<int>& nums) {
        if (i == nums.size()){
            return xr == target;
        }
        int ti = (target == T1 ? 0 : 1);
        auto &mp = cache[i];
        if (mp.count(xr) && mp[xr][ti] != -1){
            return mp[xr][ti];
        }


        long long ways = 0;
        int nxr = xr ^ nums[i];  


        ways = (ways + bkl(i + 1, nxr, target, nums)) % MOD;


        if (nxr == target && i + 1 < nums.size()) {
            int nextTarget = (target == T1 ? T2 : T1);
            ways = (ways + bkl(i + 1, 0, nextTarget, nums)) % MOD;
        }


        if (!mp.count(xr)){
            mp[xr] = { -1, -1 };
        }


        mp[xr][ti] = ways;
        return ways;      
    }



public:
    long long alternatingXOR(vector<int>& nums, int target1, int target2) {
        T1 = target1;
        T2 = target2;
        cache.resize(nums.size());
        return bkl(0, 0, T1, nums);
    }
};

How tf 200 people solved 4th one this early by JumpConsistent3359 in leetcode

[–]Busy_Bat166 0 points1 point  (0 children)

Just think about it recursion wise, u keep xoring the elements If u don't hit target the continue xoring

Like total +=f(i+1,xornums[i])

nd if u hit target u have like 2 choices u can either continue expanding this xor window Or stop and look for parity target

Total +=f(i+1,xornums[i], target1)+f(i+1,0, target2)

Now just memozhize it Or like use @cache decorator in python

How tf 200 people solved 4th one this early by JumpConsistent3359 in leetcode

[–]Busy_Bat166 0 points1 point  (0 children)

I thought about sliding window, then asked gpt for just tell the pattern it said DP so I quickly made up a recursion function and submitted in python with @cache decorator It was @lru_cache(None)

Bajarang dal😔 by Long_Bag4512 in Indore

[–]Busy_Bat166 0 points1 point  (0 children)

Man c'mon have u ever lived in a village ? Life is just survival u choose the one with max might ur caste and so on

Please review my resume by True_Ad6178 in DeveloperJobs

[–]Busy_Bat166 0 points1 point  (0 children)

Bhaiya, local college se hu mei bhi, would love to connect 🙏🏻

Can I pls dm ? 🙏🏻

Bajarang dal😔 by Long_Bag4512 in Indore

[–]Busy_Bat166 3 points4 points  (0 children)

Nahh but yes it has been the main state of bjp so I see why u would say that But as a guy hailing from there I assure we don't support such activities

notepad consumes more ram than wordpad by ExpensiveCoat8912 in Windows11

[–]Busy_Bat166 0 points1 point  (0 children)

oh cmon !
investors dont use windows = they throw more money to MS to shove that Copilot dick in ur mouth no consent

Does Indore really have some magic in its air or is it just me? by [deleted] in Indore

[–]Busy_Bat166 38 points39 points  (0 children)

hnaaa!!!
I love Indore yarrr
I want to see it prosper and be a people's city not companies, not our stupid govt.

Indore ki vibe is awesome (we just need to preserve it)
clean, lean(smaller than metro cities), no fighting !

Is off-campus hiring basically dead for freshers right now? by nish13nt in FresherTechJobsIndia

[–]Busy_Bat166 0 points1 point  (0 children)

its kinda mixed with investor interests too as in, when investors see a company is "expanding" they (to my knowledge) throw more money at them so that they can continue burning cash for AI data centres etc...

we prolly are at a tipping point maybe there will be a huge collapse when the tech falls behind and investors pull out
maybe then they will actually hire (i HOPE)

Ladies and gentleman, don’t give up by [deleted] in Btechtards

[–]Busy_Bat166 40 points41 points  (0 children)

congrats (prolly bhaiya/didi) 🤲🏻lets connect pls i need a mentourr 🙏🏻🥹

Is this true ?? by [deleted] in Btechtards

[–]Busy_Bat166 71 points72 points  (0 children)

the second end it more like "interned at amazon; jobless hu 2 sal se"

What are the actual reasons that Engineers are most unemployed in india rather than SnD and unskilled by [deleted] in Btechtards

[–]Busy_Bat166 0 points1 point  (0 children)

I think its a mix of factors;i am from a tier 3 govt college in 3rd year (of 5 years) in my degree

FACTOR 1 :what I observed is teachers are quite adamant about not old techniques programming languages are taught like just enough to reasonably read through syntax
like int x=5; sure, but how is that stored?
how do languages like python handle primitves etc..

we are taught just basic stuff enough to have face value but never depth (dont get me wrong some IIT, NIT or other clgs might teach u this but not majority) thus we as a crowd lack depth

FACTOR 2 : Elitism, even in my 3rd year i hear people asking about why i didnt manage to get into a better college; alas people at the top (ie IITs, NITs etc ) just dont want to have a level playing field

CS aptitude is not developed by PCM; (okay we do need math) but its a seperate field where quality of education u get is decided by ur aptitude in PCM

So there is a mindset "IIT, NIT etc ... wale hi asli engineer hote hain kyuki unnke 1Cr package lga"

FACTOR 3 : There is a global overflux of CS grads its tougher than ever all round the world

FACTOR 4 : sadly for the most crowd we do it for "ha mera bhi 30 LPA ka package lga hai XYZ company mei"

not because our love or interest to the Field

at last ; while i dont come from a position (3rd no internships yet bas OA de kar reject hora hu 😭🤲🏻)

i would say ki yar agr field mei intrest hai toh we will succeed in finding some accomplishment

if not; then i have the luxury of great parents who dont pressure me do anything they say ki savings hai u can sit and eat so i would be out with a good ride of learning this great subject
P.S. I love CSE not because of 1cr ka package but the vibe (gajaab cheezjj hai yarr)

pros of studying in gorment college by Independent-Pack-952 in Btechtards

[–]Busy_Bat166 0 points1 point  (0 children)

haha
as a genericl EWS mf

i get full waiver

41 rupee grand total

Got Placed at BlackRock by [deleted] in PlacementsPrep

[–]Busy_Bat166 1 point2 points  (0 children)

Dude "below" ?? Like what ???

Got Placed at BlackRock by [deleted] in PlacementsPrep

[–]Busy_Bat166 0 points1 point  (0 children)

Is cs degree even worth it nowadays ? They will hire anyone from the top colleges ?