Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Solved. But should I comment it or not... Nah, people need to figure it out without help, it's quite simple.
-
So how do we go about this? If i do t comment my answer how will you see the coder in me?
-
Amrish14288y@fox8091 Answer here
https://docs.google.com/forms/d/...
Upvote this comment so that everyone can know where to answer -
Amrish14288yEveryone knows the answer but when I give the link to the form to answer no one answers.
¯\_(ʘ_ʘ)_/¯ -
Amrish14288y@Artemix I don't know how you did it. it's great Congo. Give your answers at form and comment on the rant. I will +1 your comment if answer was correct.
-
Amrish14288y@Artemix I saw your answer, it's correct :) . The later part of my previous comment was for others who still have not answered.
-
Amrish14288y@varundey It's correct, great! I get very different solutions. The solution can be still made neat. I will post my solution and all other solutions posted tomorrow.
-
Amrish14288y@varundey My bad, after all Xor seems to be faster than addition/subtraction.
¯\_(ツ)_/¯ -
dfox428278y@aul12 we definitely like that idea and we've been looking at some possible features along those lines.
-
@Amrish Hey dude! I didn't check my notifications for too long. I sent it via form, but here's MD5 anyway: 06fb0a429b07b4defa09a2e21063f678
-
osmarks8678yI got this after 5 minutes fiddling with [The binary operator used has been redacted].
-
I almost didn't go to sleep because of this task. Nice challenge.
I look forward to new ones :D -
Bikonja23868yThe hardest part was remembering the syntax as I don't use it ever in actual code :)
-
I'll post mine, only because I doubt anyone went this route lol:
#include <iostream>
#include <math.h>
using namespace std;
int main()
{
int number;
cin >> number;
cout << floor(abs(tan(number)+.5)) << endl;
return 0;
} -
Amrish14288yHi everyone. That was an overwhelming response. To my surprise I found more than 10 different correct solutions submitted!! Great!
I will post all the solutions within 5 hours. It's different time here (India), I just woke up.
I have not upvoted some comments cause I need a compiler to check them out. I have not upvoted if you had directly commented the answer. -
This was fun -- more please?
And I thought I had a good solution...that 2 character solution is the best lol! -
Amrish14288yHi everyone, follow the link to get all unique solutions given. I have attached repeated solutions too. Great work!
https://drive.google.com/open/...
I had no time to put a proper formatting
¯\_(ツ)_/¯ . Certain solutions were impressive 😎 -
Amrish14288yCongo @Artemix @Varundey @aul12 @leriaz @TheSilent @cuboidcat @ste26054 @bukovles @W3D3 @vzqzac @Thaon @Gprabhat @asdf 😎 Thanks @dfox.Lets use #devcode tag for more of these :D
-
Amrish14288y@alexanderholman you had to fill the answers in the form link I had given in my previous comments. :)
-
Bikonja23868y@Artemix that was actually the solution I thought of first, but I decided there's a shorter way so I XORed with 3 because how often do you get a chance to use XOR? :)
-
Amrish14288y@filthyranter Sorry bro, I had missed out your solution, I scrutinized the results so fast (10 mins).
Solution: 1+(number != 2)
This solution is correct and unique 😎.
This makes 16 unique solutions 😎. Great work people!!
Related Rants
Let's see the coder in you.
If I give input: 1 output: 2
If I give input: 2 output:1
Only these two test cases needed.
You should not use control structures such as if,else,for,while,switch etc. (The answer is simple) (Don't cheat)
int number;
cin>>number; //get number
cout<<??????; //Your code
undefined
algorithm
coding