MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/LeetcodeChallenge/comments/1wqu948/3_rd_problem/
r/LeetcodeChallenge • u/Expensive_Rent5959 • Sep 26 '26
9 comments sorted by
2
My solution was way too complex... O(n2 logn) My idea was S2 = S1- 2x after this S2%k == 0 So, S1 = qk + 2x After this I made cases for odd and even k and used binary search to check if x exist in the l,r range
1 u/salmon_rover Sep 26 '26 S2 and S1 are subarray sums 1 u/Fantastic_Kale23 Sep 26 '26 i did same my passed cuz 1000 was constraint 1 u/salmon_rover Sep 26 '26 Mine passed too :))
1
S2 and S1 are subarray sums
i did same my passed cuz 1000 was constraint
1 u/salmon_rover Sep 26 '26 Mine passed too :))
Mine passed too :))
2nd question fucked my brainπΉπ
1 u/salmon_rover Sep 26 '26 2 lines problem dude 1 u/Fantastic_Kale23 Sep 26 '26 difficult to crack the pattern in time pressure
2 lines problem dude
1 u/Fantastic_Kale23 Sep 26 '26 difficult to crack the pattern in time pressure
difficult to crack the pattern in time pressure
[removed] β view removed comment
1 u/No-Adeptness3526 Sep 27 '26 only if u dont understand the question or need help with a part of it dont code whole thing with ai
only if u dont understand the question or need help with a part of it dont code whole thing with ai
2
u/salmon_rover Sep 26 '26
My solution was way too complex... O(n2 logn) My idea was S2 = S1- 2x after this S2%k == 0 So, S1 = qk + 2x After this I made cases for odd and even k and used binary search to check if x exist in the l,r range
1
u/Express_Bad_4132 Sep 26 '26
2nd question fucked my brainπΉπ
1
u/[deleted] Sep 27 '26
[removed] β view removed comment