WEIRD CHALLENGE (WasteYourTime1) | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 7

WEIRD CHALLENGE (WasteYourTime1)

MAKE A PROGRAM LIKE THIS EXAMPLE 1 INPUT=7391 OUTPUT 9=7+3-1 7=9-3+1 3=9-7+1 1=7+3-9 (NOT AS 9=9+3-3) EXAMPLE 2 INPUT=3573 OUTPUT 7=7 (NOT AS 7=3+3-5+3+3) 5=5 3=3 (HERE IMPOSSIBLE TO MAKE ANY OPERATIONS) ( ALSO ONLY ONE TIME 3) I HOPE YOU UNDERSTAND THIS /*COMPLETE THIS CHALLENGE AND I WILL GIVE YOU NOTHING*/ /*JUST WASTE YOUR TIME AND BE SMART*/

29th Sep 2017, 7:34 AM
RANDOM1
RANDOM1 - avatar
21 Answers
+ 14
What do you mean by "Also only one time 3"?
29th Sep 2017, 9:46 AM
Krishna Teja Yeluripati
Krishna Teja Yeluripati - avatar
+ 9
https://code.sololearn.com/c4LwcyMzUpqE/#cs My solution in just 189 lines of code :D...
1st Oct 2017, 8:55 PM
Vukan
Vukan - avatar
+ 5
Okey my code is only for numbers with 4 digits but it seems to work. It starts generally for any number of digits but I can't find a generic formula... Sorry, this is not a beautiful code... But now "only one time 3" condition is respected :D (maybe) https://code.sololearn.com/cDdjU3PN5EX1/?ref=app
29th Sep 2017, 9:43 AM
Andrea Simone Costa
Andrea Simone Costa - avatar
+ 4
Lmao no it gives you problem solving strategies. But I find it quite hard
29th Sep 2017, 7:43 AM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
+ 4
My response in Ruby: https://code.sololearn.com/cU9Agya12Yaa/?ref=app It can take any input number, and I think it fulfills all the requirements. Not yet any validation of the input value, so careful to only enter numbers, but should work well otherwise.
29th Sep 2017, 6:52 PM
André
André - avatar
+ 3
means input 3573 wrong output 7=7 5=5 3=3 3=3 right output 7=7 5=5 3=3 got it ? mr. krishna
29th Sep 2017, 9:55 AM
RANDOM1
RANDOM1 - avatar
+ 3
if input is 9988, right output is 9 = 9 8 = 8 ? I got 9 = 9 + 8 - 8 but i dont care ahahah
29th Sep 2017, 10:02 AM
Andrea Simone Costa
Andrea Simone Costa - avatar
+ 3
ok your choice /* your code is really good */ @andrea
29th Sep 2017, 10:19 AM
RANDOM1
RANDOM1 - avatar
+ 2
nice logic i loved it...😘😘
29th Sep 2017, 10:28 AM
Arun kumar
Arun kumar - avatar
+ 2
In my code I interpreted the question meaning the equation needed to use ALL the remaining digits of the number, given the examples in the original post. This might not have been exactly the intention, but the code works for that interpretation, and a fun challenge regardless.
29th Sep 2017, 7:19 PM
André
André - avatar
+ 2
excellent @andré /* it doesn't work properly on (2211, 4422) input*/ /*it needs little bit perfection*/ /*all thing is great but problem is with me i cant understand ruby*/ /*great work really*/
30th Sep 2017, 6:25 AM
RANDOM1
RANDOM1 - avatar
+ 1
yes right
29th Sep 2017, 10:17 AM
RANDOM1
RANDOM1 - avatar
+ 1
Too much time wasted ;) I'm happy with my 9 = 9 + 8 - 8 Anyway take a look at my code :)
29th Sep 2017, 10:18 AM
Andrea Simone Costa
Andrea Simone Costa - avatar
+ 1
Thanks ;) The best answer is for me? Ahahah :P
29th Sep 2017, 10:20 AM
Andrea Simone Costa
Andrea Simone Costa - avatar
+ 1
Good work @André
29th Sep 2017, 10:01 PM
Andrea Simone Costa
Andrea Simone Costa - avatar
+ 1
Thanks for the feedback @RANDOM1! I misinterpreted the challenge, I thought it meant only for unique digits in the number. I have fixed the code - should work now for numbers like 2211 and 4422! I will add comments to the code later to explain my process.
30th Sep 2017, 11:01 AM
André
André - avatar
+ 1
no please dont explain i need to learn ruby from scratch i dont wanna waste your time ok @andré
30th Sep 2017, 11:50 AM
RANDOM1
RANDOM1 - avatar
+ 1
No no @andré explain 4 me ahaha
30th Sep 2017, 11:51 AM
Andrea Simone Costa
Andrea Simone Costa - avatar