Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • 1
    \$\begingroup\$ Your method for checking that there's an even number of letters between the bs seems very long. How about .'b'/1=,2%? \$\endgroup\$ Commented Jun 20, 2013 at 10:10
  • \$\begingroup\$ And you can avoid discarding failed attempts by pulling the 'qbbnnxxx' out of the loop and reshuffling the same string. \$\endgroup\$ Commented Jun 20, 2013 at 10:15
  • \$\begingroup\$ @PeterTaylor Thank you for the great tips. For the "count between 'b's" issue I felt that there should be a shorter way, but I just couldn't find it. \$\endgroup\$ Commented Jun 20, 2013 at 11:23