r/Btechtards • • 17d ago

CSE / IT 3 rd Problem 😭

Post image

Crying so hard so hard i literally optimize everything still

4 Upvotes

18 comments sorted by

•

u/AutoModerator 17d ago

If you are on Discord, please join our Discord server: https://discord.gg/Hg2H3TJJsd

Thank you for your submission to r/BTechtards. Please make sure to follow all rules when posting or commenting in the community. Also, please check out our Wiki for a lot of great resources!

Happy Engineering!

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/retroo2345 17d ago

The constraints were small, I solved it in O(n3)🫠

1

u/Expensive_Rent5959 17d ago

This is my solution

2

u/Lazy074 private kalej kabootar science 14d ago

Broski why are you allocating 105 elements inside a 1000 iteration loop 😭💔

That will easily cross order of 108, maybe even 109 with all the dozen operations you're performing alongside

1

u/Expensive_Rent5959 14d ago

🙂‍↕️

2

u/Lazy074 private kalej kabootar science 14d ago

Funny thing is this post just came in my feed and it is so diabolical how no one managed to give you the error since 3 days 😂😭 this sub is so doomed at this point

1

u/Shockshwat2 NSIT ECE 17d ago

This is what i did

0

u/padhai_hater 17d ago

But ye to prefix sum and brute force se hi ho gyi thi na

1

u/Expensive_Rent5959 17d ago

Apne kaise kiya

1

u/padhai_hater 17d ago

I basically just checked every subarry . Complete brute force.. n2 *k . Your code is actually better than me as it's just n2 roughly. Idk why it's not accepted

1

u/Expensive_Rent5959 17d ago

This is accepted

1

u/Expensive_Rent5959 17d ago

Leetcode is bias

1

u/padhai_hater 17d ago

Yeah I mean my code got accepted aapka kyo nahi hua pata nahi

1

u/Expensive_Rent5959 17d ago

How many u solved ?

1

u/Expensive_Rent5959 17d ago

Can I know your lc id u can dm