I don't understand, can you explain the second rule?
all combinations of x & y of length n
1. they must appear n/2 times each
2. no initial segment of the string has more y's than x's
so, 'yyxyxx' -- the 2nd rule is broken here. since 1st appearance of x contains only one x while y [the second element] contains 2.
count (1stelement) >= count (2nd element) >= count (3rd element) ..
Hope this makes it clear
@Asif, thank you! I see.
Return the 3n+1 sequence for n
Renaming a field in a structure array
Omit columns averages from a matrix
Back to basics 10 - Max Float
Poker Series 06: isThreeKind
Sky full of stars - 01
Don't be Greedy!
Minimal Path - 02
Find the treasures in MATLAB Central and discover how the community can help you!
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office