Skip to main content
Commonmark migration
Source Link

#Carrot, 3 bytes

Carrot, 3 bytes

1$$ 

Try it online!

(input is newline separated)

Similar to ais529's answer, except this takes care of leading zeroes. This outputs 1 concatenated with both the input numbers. So 5\n6 outputs 156.

Alternate solutions:

###6 bytes

6 bytes

1$$^*1 

Same thing as the above solution, but concatenates it with a copy of itself. So 5\n6 becomes 156 which then becomes 156156.

###8 bytes

8 bytes

#^A +1+ 

(note the trailing space, the input is space separated this time)

#^A +1+ #^ //gets all of the input A //convert it an array splitting on spaces +1 //add 1 to each of the array's elements + //sums up all the elements in the array 

#Carrot, 3 bytes

1$$ 

Try it online!

(input is newline separated)

Similar to ais529's answer, except this takes care of leading zeroes. This outputs 1 concatenated with both the input numbers. So 5\n6 outputs 156.

Alternate solutions:

###6 bytes

1$$^*1 

Same thing as the above solution, but concatenates it with a copy of itself. So 5\n6 becomes 156 which then becomes 156156.

###8 bytes

#^A +1+ 

(note the trailing space, the input is space separated this time)

#^A +1+ #^ //gets all of the input A //convert it an array splitting on spaces +1 //add 1 to each of the array's elements + //sums up all the elements in the array 

Carrot, 3 bytes

1$$ 

Try it online!

(input is newline separated)

Similar to ais529's answer, except this takes care of leading zeroes. This outputs 1 concatenated with both the input numbers. So 5\n6 outputs 156.

Alternate solutions:

6 bytes

1$$^*1 

Same thing as the above solution, but concatenates it with a copy of itself. So 5\n6 becomes 156 which then becomes 156156.

8 bytes

#^A +1+ 

(note the trailing space, the input is space separated this time)

#^A +1+ #^ //gets all of the input A //convert it an array splitting on spaces +1 //add 1 to each of the array's elements + //sums up all the elements in the array 
Source Link
user41805
  • 13.4k
  • 6
  • 43
  • 88

#Carrot, 3 bytes

1$$ 

Try it online!

(input is newline separated)

Similar to ais529's answer, except this takes care of leading zeroes. This outputs 1 concatenated with both the input numbers. So 5\n6 outputs 156.

Alternate solutions:

###6 bytes

1$$^*1 

Same thing as the above solution, but concatenates it with a copy of itself. So 5\n6 becomes 156 which then becomes 156156.

###8 bytes

#^A +1+ 

(note the trailing space, the input is space separated this time)

#^A +1+ #^ //gets all of the input A //convert it an array splitting on spaces +1 //add 1 to each of the array's elements + //sums up all the elements in the array