**New course!**Every coder should learn

**Generative AI!**

+ 7

# 12345 Puzzle! Try to solve!

Idea inspired from Agus Mei's quizzes! What is the result if all 5 digit numbers containing each of the digits 1,2,3,4,5 exactly once are added? Logic/Program solution should be given.

11 Answers

+ 25

@Krishna Teja Yeluripati
5! = 120 numbers possible, if we'll sum numbers with mirrored digits (12345 and 54321, 51324 and 15342...) we get 66666 for each pair of numbers; 66666 * 60 = 3999960

+ 21

3999960

+ 10

5!=120
12345
+54321 120/2=60
------------
66666
66666
x60
-------------
3,999,960

+ 9

120/5=24
24*120=2880?
Just a guess that's wrong.

+ 7

Oh. :| I dont think my logic works with floating points

+ 7

@Illusive Man : Logical Solution.
@Klaus-Dieter Warzecha - Program Solution.
Well Done!

+ 6

Working on it
https://code.sololearn.com/cL8uMST67bnN/?ref=app

+ 5

@Illusive man : Can you give the logic/program?

+ 5

@Sweet Emotion : You are getting compilation error because maximum value of int is 32767.

+ 3

If you prefer brute force and recognize that this is about permutations:
https://code.sololearn.com/c30Msv90uSbA

+ 1

This is a great idea, give me some time, I think I can do it :)