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.
It dseon't mettar waht oedrr the lrettes in a wrod are.
How to find the position of an element in a vector without using the find function
Solving a quadratic equation
Next Higher Power of B
Yoonir - 01
Abelian Sandpile - 02
Don't be Too Greedy!!
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