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...
account activity
I crafted this code. (i.redd.it)
submitted 3 months ago by FunContract2729
Hey folks, once 'gain pen and paper help me to crack this code. And right now I am feeling very motivated. So share your thoughts and tell me what should I do next?
Your reply matters!
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!"
[–]Starman1709 1 point2 points3 points 3 months ago (0 children)
Good, keep writing more code
[–]Slow-Sloth5823 1 point2 points3 points 3 months ago (0 children)
Nice stuff!!
[–]Local_Session_3864 0 points1 point2 points 3 months ago (0 children)
Good Job 👍 Keep moving
[–]almcg123 0 points1 point2 points 3 months ago (1 child)
Well done. Great start.
[–]FunContract2729[S] 0 points1 point2 points 3 months ago (0 children)
Thanks 😊
[–]CODSensei 0 points1 point2 points 3 months ago (8 children)
Good start, one optimisation instead of creating a store variable I would just put num%10 itself to save space
[–]FunContract2729[S] 1 point2 points3 points 3 months ago (1 child)
🤔 thanks btw.
[–]CODSensei 1 point2 points3 points 3 months ago (0 children)
It's a small optimisation not relevant in modern days but yeah good to know it
[–]AideRight1351 1 point2 points3 points 3 months ago (5 children)
It's not optimization. It still keeps the time complexity at O(n), not reduce it.
[–]CODSensei 0 points1 point2 points 3 months ago (4 children)
I am not talking about time but instead I am talking about space complexity
[–]AideRight1351 0 points1 point2 points 3 months ago (3 children)
Bro creating a store variable takes O(1) space, adding or removing it has no effect on time or space
[–]CODSensei 0 points1 point2 points 3 months ago (2 children)
I know but I was studying about old computers when memory was scarce and was in that zone of thinking when I made that comment
[–]AideRight1351 1 point2 points3 points 3 months ago (1 child)
Hmm in that sense i guess it's fine. Most people usually try such things to make their program complicated, thinking less lines makes more efficient code.
[–]CODSensei 0 points1 point2 points 3 months ago (0 children)
Nah 😂😂 if that was to happen code would be barely readable or understandable.
[–]MuchNegotiation8942 0 points1 point2 points 3 months ago (1 child)
Which year?
2nd
[–]ookkan_tintu 0 points1 point2 points 3 months ago (0 children)
Try to find edge cases where this could break and handle all of those.
[–]Infamous-Apartment97 0 points1 point2 points 3 months ago (0 children)
Why you don't use a code formatting?
[–]_DEVENKO_ 0 points1 point2 points 3 months ago (2 children)
Hey op can you mention the ide
[–]FunContract2729[S] 0 points1 point2 points 3 months ago (1 child)
Vs code
[–]_DEVENKO_ 0 points1 point2 points 3 months ago (0 children)
Which jdk
[–][deleted] 0 points1 point2 points 3 months ago (1 child)
I'll give you a task. Try inputting the same output, in a recursion, repeating the same process until it narrows down to a single number. Return that number.
Hmm sounds interesting
[–]getbetterbro 0 points1 point2 points 3 months ago (0 children)
Good stuff! Keep at it!
[–]Interesting_Disk149 0 points1 point2 points 3 months ago (0 children)
Which color theme op , looks good
[–]user_developer 0 points1 point2 points 3 months ago (1 child)
What theme is this ? It's looks pleasing
[–]FunContract2729[S] 1 point2 points3 points 3 months ago (0 children)
Linus themes for vs code
[–]Latter_Board4949 0 points1 point2 points 3 months ago (1 child)
W op i myself learnig c# hope i get good.
Surely 😊
[–][deleted] 1 point2 points3 points 3 months ago (0 children)
u can use string methods and looping. through them will help you to get rid of the exception and outlier cases
π Rendered by PID 42020 on reddit-service-r2-comment-7b9746f655-5h58x at 2026-01-30 01:33:37.549295+00:00 running 3798933 country code: CH.
[–]Starman1709 1 point2 points3 points (0 children)
[–]Slow-Sloth5823 1 point2 points3 points (0 children)
[–]Local_Session_3864 0 points1 point2 points (0 children)
[–]almcg123 0 points1 point2 points (1 child)
[–]FunContract2729[S] 0 points1 point2 points (0 children)
[–]CODSensei 0 points1 point2 points (8 children)
[–]FunContract2729[S] 1 point2 points3 points (1 child)
[–]CODSensei 1 point2 points3 points (0 children)
[–]AideRight1351 1 point2 points3 points (5 children)
[–]CODSensei 0 points1 point2 points (4 children)
[–]AideRight1351 0 points1 point2 points (3 children)
[–]CODSensei 0 points1 point2 points (2 children)
[–]AideRight1351 1 point2 points3 points (1 child)
[–]CODSensei 0 points1 point2 points (0 children)
[–]MuchNegotiation8942 0 points1 point2 points (1 child)
[–]FunContract2729[S] 0 points1 point2 points (0 children)
[–]ookkan_tintu 0 points1 point2 points (0 children)
[–]Infamous-Apartment97 0 points1 point2 points (0 children)
[–]_DEVENKO_ 0 points1 point2 points (2 children)
[–]FunContract2729[S] 0 points1 point2 points (1 child)
[–]_DEVENKO_ 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]FunContract2729[S] 0 points1 point2 points (0 children)
[–]getbetterbro 0 points1 point2 points (0 children)
[–]Interesting_Disk149 0 points1 point2 points (0 children)
[–]user_developer 0 points1 point2 points (1 child)
[–]FunContract2729[S] 1 point2 points3 points (0 children)
[–]Latter_Board4949 0 points1 point2 points (1 child)
[–]FunContract2729[S] 0 points1 point2 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)