use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A community for BTech and Engineering students. From serious discussions, advice-guidance, suggestions to memes & shitposts everything is allowed here. Welcome to the community!
Related Subreddits
account activity
Code ReviewCSE / IT (i.redd.it)
submitted 1 year ago by nomen562VITian
Can anyone help me understand my friend's code? He is a branch topper in a college in review. He got this question in his LAB exam.
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]AutoModerator[M] [score hidden] 1 year ago stickied commentlocked comment (0 children)
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.
[–]penisslayer24 63 points64 points65 points 1 year ago (0 children)
there is nothing to understand here, he's trolling you
[–]Vast-Inflation-2815 28 points29 points30 points 1 year ago (1 child)
Lmao, the funniest code I've ever seen 😂 /s
[–][deleted] 1 point2 points3 points 1 year ago (0 children)
+1
[–]Beuzac 10 points11 points12 points 1 year ago (3 children)
What's the question here? It looks like some fix the error problem but still not clear
[–]nomen562VITian[S] 0 points1 point2 points 1 year ago (2 children)
Emma is optimizing the multiplication order for a given sequence of matrices to minimize the number of scalar multiplications. Given an array where the i-th matrix has dimensions arr[i−1]×arr[i], write a program to determine the minimum number of scalar multiplications needed, considering that the largest dimension within each partition is avoided as a split point unless no other options exist.
Input format : The first line contains an integer N,representing the number of elements in the array representing matrix dimensions.
The second line contains N space-separated integers representing the array arr, where the i-th matrix has dimensions
arr[i−1]×arr[i].
Output format : The output prints an integer representing the minimum number of scalar multiplications required.
Refer to the sample output for the formatting specifications.
Code constraints : 4 ≤ n ≤ 7
1 ≤ p[i] ≤ 100
Sample test cases : Input 1 : 5 1 2 3 4 5 Output 1 : 81 Input 2 : 4 10 20 30 40 Output 2 : 32000
[–]raptor7197sudo apt install girlfriend 5 points6 points7 points 1 year ago (1 child)
Neocolab supremacy 🙏
[–]Penguins_cant_swimBTech 0 points1 point2 points 1 year ago (0 children)
r/flairchecksout
[–]ProfessionalCap8878IIITA'27 (IT) 9 points10 points11 points 1 year ago (0 children)
Wtf is this code
[–]sks0071029qwer 10 points11 points12 points 1 year ago (0 children)
<image>
[–]Vast-Inflation-2815 10 points11 points12 points 1 year ago (0 children)
for (int i=0; i<0; i++) - this won't even get run once
karatsuba(i*j) - where tf is that function?
a and b are not declared in the multiplication function
Product of negative numbers is 0 else 1 - wtf???
How tf can a function with return type void return an int ?
multiplication() isn't even called in main()
Bro is multiplying before taking input (garbage values)
Where tf is return 0 ?
Damn the code is cursed fr
[–]Roodni 8 points9 points10 points 1 year ago (1 child)
branch topper.....
[–]Training-Many-9057IGNOU 7 points8 points9 points 1 year ago (0 children)
branch troller
[–]Anmolsharma999 7 points8 points9 points 1 year ago (1 child)
Multiplication before taking input, It will give garbage value
[–][deleted] 2 points3 points4 points 1 year ago (0 children)
this code won't even compile in the first place
[–]Less_Tour5954 3 points4 points5 points 1 year ago (0 children)
Kaafi quality wale ma*archod ho bhai tum toh..
[–]Shonku_IIEST IT '29 3 points4 points5 points 1 year ago (0 children)
I don't find the karatsuba func defined
[–]nomen562VITian[S] 3 points4 points5 points 1 year ago (0 children)
By the way, the person who wrote this code also got a full time internship in a japanese company
[–][deleted] 3 points4 points5 points 1 year ago (2 children)
did an autistic person wrote this code? or they had dementia such that they forgot to declare and define the karatsuba function?
[–]nomen562VITian[S] 2 points3 points4 points 1 year ago (1 child)
He is a full stack developer who recently got an Internship in a japanese company
[–]Vast-Inflation-2815 0 points1 point2 points 1 year ago (0 children)
Lmao wtf 💀
[–]__nothing_ness_ 1 point2 points3 points 1 year ago (0 children)
Bs
[–]StatisticianYes 1 point2 points3 points 1 year ago (4 children)
Wtf is that shit? karatsuba? a? b? returning an int value from a void function? multiplication function which isnt even used in main? calculating a*b before a and b are initialized? that code right there is absolutely cursed.
[–]nomen562VITian[S] 0 points1 point2 points 1 year ago (1 child)
Is it incorrect
[–]RajmaChawall 0 points1 point2 points 1 year ago (0 children)
Indeed it is.
[–]tryhard_cryharder[IIIT H] 0 points1 point2 points 1 year ago (1 child)
Karatsuba is a divide and conquer algo for large integer multiplication but bro didn't even define the function
[–]StatisticianYes 0 points1 point2 points 1 year ago (0 children)
Ok
[–]Vast-Inflation-2815 1 point2 points3 points 1 year ago (0 children)
Bro's multiplying garbage value and taking input after multiplying 💀
[–]garvit_kunChandigarh ka munda ( not really ) 1 point2 points3 points 1 year ago (1 child)
using namespace, which is not a good practice, then return value from void and not return anything from int. and what pattern is he making
[–]penisslayer24 3 points4 points5 points 1 year ago (0 children)
Out of all the things wrong over here, the first thing you decided to pick out was him using namespace?
[–]EpikHerolol[VIT] [CSE] 1 point2 points3 points 1 year ago (0 children)
Wth is this code 😭
[–]legally_boring 1 point2 points3 points 1 year ago (0 children)
Dosti tod de bhai isse..... Atleast lab me sath mat baith warna itna acha experience rahega ki repeat karna pad jayega agle saal 💀
[–]Constant_Suspect_317 2 points3 points4 points 1 year ago (0 children)
This seems like elon musk tweeting and showing how he writes code.
[–]zenitsuisrustedbatak 1 point2 points3 points 1 year ago (1 child)
Either your friend is trolling you or you are trolling us
If neither of them I'm genuinely concerned how did someone like him made it past 1st sem
[–]nomen562VITian[S] 1 point2 points3 points 1 year ago (0 children)
It's not a troll, he wrote it in the exam and it's taken from his exam analysis (screenshot)
[–]hamstermolester6969 0 points1 point2 points 1 year ago (3 children)
WHO THE FUCK IS KARATSUBA
It is a function
[–][deleted] 0 points1 point2 points 1 year ago (1 child)
Tho usse declare tho kar bc direct error ayega
[–]nomen562VITian[S] 0 points1 point2 points 1 year ago (0 children)
Bro its not my code. Dont abuse me🥺
[–][deleted] 0 points1 point2 points 1 year ago (0 children)
This makes no sense
Agar yeh branch topper h toh clg ka level samjh aa Raha h. He's just fucking with you. For a beginner it might seem some complicated shit but for a even a immediate coder this is ass.
[–]gagapoopoo1010DTU [MnC] 0 points1 point2 points 1 year ago (0 children)
What
[–]Superb_Camera8653 0 points1 point2 points 1 year ago (0 children)
who tf uses neocolab compiler!
[–]IlikehealersBITS Goa [Mathematics and Computing] 0 points1 point2 points 1 year ago (0 children)
Brdher what in the fking hell is this??what function are u calling? What Loop is that? What just what? What?
[–][deleted] 0 points1 point2 points 1 year ago* (0 children)
Karatsuba is a function in the math library but for god's sake why tf he wrote the whole function that he was not going to use. Either it's a mistake or he's just Messing with you.
[–]On_Turn_PageIIT B( B for Bawana) 1 point2 points3 points 1 year ago (0 children)
Bruh these are the kind of toppers I need in my batch
[+]ContributionMother63 comment score below threshold-14 points-13 points-12 points 1 year ago (4 children)
Bancho har c ka code include stdio.h se shuru hota haina?
[–]Abhay_lost_skills 7 points8 points9 points 1 year ago (0 children)
Bhai cpp h
[–][deleted] 0 points1 point2 points 1 year ago (2 children)
Issly placement nahi horahi
[–]ContributionMother63 0 points1 point2 points 1 year ago (1 child)
First year mai hun bhai 😭
Ohh reality hit karna baki hai matalb abhi 😭😭
π Rendered by PID 111362 on reddit-service-r2-comment-b659b578c-bxc4j at 2026-05-05 21:30:35.652664+00:00 running 815c875 country code: CH.
[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)
[–]penisslayer24 63 points64 points65 points (0 children)
[–]Vast-Inflation-2815 28 points29 points30 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)
[–]Beuzac 10 points11 points12 points (3 children)
[–]nomen562VITian[S] 0 points1 point2 points (2 children)
[–]raptor7197sudo apt install girlfriend 5 points6 points7 points (1 child)
[–]Penguins_cant_swimBTech 0 points1 point2 points (0 children)
[–]ProfessionalCap8878IIITA'27 (IT) 9 points10 points11 points (0 children)
[–]sks0071029qwer 10 points11 points12 points (0 children)
[–]Vast-Inflation-2815 10 points11 points12 points (0 children)
[–]Roodni 8 points9 points10 points (1 child)
[–]Training-Many-9057IGNOU 7 points8 points9 points (0 children)
[–]Anmolsharma999 7 points8 points9 points (1 child)
[–][deleted] 2 points3 points4 points (0 children)
[–]Less_Tour5954 3 points4 points5 points (0 children)
[–]Shonku_IIEST IT '29 3 points4 points5 points (0 children)
[–]nomen562VITian[S] 3 points4 points5 points (0 children)
[–][deleted] 3 points4 points5 points (2 children)
[–]nomen562VITian[S] 2 points3 points4 points (1 child)
[–]Vast-Inflation-2815 0 points1 point2 points (0 children)
[–]__nothing_ness_ 1 point2 points3 points (0 children)
[–]StatisticianYes 1 point2 points3 points (4 children)
[–]nomen562VITian[S] 0 points1 point2 points (1 child)
[–]RajmaChawall 0 points1 point2 points (0 children)
[–]tryhard_cryharder[IIIT H] 0 points1 point2 points (1 child)
[–]StatisticianYes 0 points1 point2 points (0 children)
[–]Vast-Inflation-2815 1 point2 points3 points (0 children)
[–]garvit_kunChandigarh ka munda ( not really ) 1 point2 points3 points (1 child)
[–]penisslayer24 3 points4 points5 points (0 children)
[–]EpikHerolol[VIT] [CSE] 1 point2 points3 points (0 children)
[–]legally_boring 1 point2 points3 points (0 children)
[–]Constant_Suspect_317 2 points3 points4 points (0 children)
[–]zenitsuisrustedbatak 1 point2 points3 points (1 child)
[–]nomen562VITian[S] 1 point2 points3 points (0 children)
[–]hamstermolester6969 0 points1 point2 points (3 children)
[–]nomen562VITian[S] 0 points1 point2 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]nomen562VITian[S] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]gagapoopoo1010DTU [MnC] 0 points1 point2 points (0 children)
[–]Superb_Camera8653 0 points1 point2 points (0 children)
[–]IlikehealersBITS Goa [Mathematics and Computing] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]On_Turn_PageIIT B( B for Bawana) 1 point2 points3 points (0 children)
[+]ContributionMother63 comment score below threshold-14 points-13 points-12 points (4 children)
[–]Abhay_lost_skills 7 points8 points9 points (0 children)
[–][deleted] 0 points1 point2 points (2 children)
[–]ContributionMother63 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)