6 kyu

Shortest code: Give me the equation

Description:

This is the challenge version of coding 3min series. If you feel difficult, please complete the simple version

Task:

Give you three numbers:a b c,please return an equation(Operators include +,-,*,/), return type is string.

For example:

sc(1,2,3) should return "1+2=3" or "2+1=3" or "3-2=1" or "3-1=2"

sc(2,2,4) should return "2+2=4" or "2*2=4" or "4/2=2" or "4-2=2"

sc(6,2,3) should return "2*3=6" or "3*2=6" or "6/2=3" or "6/3=2"

Return one of the possible answer, you can pass the test.

If there is no equation between a,b,c, return ""

You code length limit is 120 chars.

Code length calculation

In javascript, we can't get the user's real code, we can only get the system compiled code. Code length calculation is based the compiled code.

For example:

If you typed sc=x=>x+1
after compile, it will be:sc=function(x){return x+1;}

Series:

Puzzles
Games
Restricted

Stats:

CreatedMar 29, 2016
PublishedMar 29, 2016
Warriors Trained248
Total Skips2
Total Code Submissions1296
Total Times Completed119
JavaScript Completions119
Total Stars9
% of votes with a positive feedback rating92% of 56
Total "Very Satisfied" Votes48
Total "Somewhat Satisfied" Votes7
Total "Not Satisfied" Votes1
Ad
Contributors
  • myjinxin2015 Avatar
  • smile67 Avatar
  • user9644768 Avatar
  • ejini战神 Avatar
Ad