Success Puzzle

john's Avatar

john

01 Jul, 2025 01:01 AM

I occasionally like to use Nodebox to solve puzzles on Quora. Today's solution was particularly satisfying:

Question: In how many ways can the letters of the word "success" be arranged such that no two "s" come next together?

The answer is 120. I was able to solve this in Nodebox using only six nodes:

(Refer to attached screenshot)

The make_strings node turns “success” into seven letters.

The orderings node, from my Cartan Node Library, produces all 5040 ways of reordering those seven letters.

The distinct node eliminates duplicates, leaving 420 distinct arrangements.

The contains node yields “true” for each arrangement that contains “ss”.

The equals node yields false for “ss” arrangements and true for all others

The cull nodes removes all arrangements containing “ss”, leaving the 120 possible arrangements.

NOTE: This assumes the two c’s in success are interchangeable. If you wanted to treat them as separate letters (e.g. if you colored the letters so the first c was blue and the second c was red), there would 240 possible arrangements. I double-checked this by simply changing the second c to an x in the first node.

Link to Quora answer: https://www.quora.com/In-how-many-ways-can-the-letters-of-the-word-...

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Already uploaded files

  • success_screenshot.png 591 KB
  • success_puzzle.ndbx.zip 6.04 KB

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

14 Jul, 2025 10:54 PM
06 Jul, 2025 10:35 PM
01 Jul, 2025 01:01 AM
29 Jun, 2025 04:39 AM
27 Jun, 2025 06:35 PM

 

25 Jun, 2025 08:54 AM
23 Jun, 2025 04:02 AM
21 Jun, 2025 08:45 AM
20 Jun, 2025 05:07 AM
19 Jun, 2025 10:26 PM
17 Jun, 2025 06:15 AM