<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Gymnast Tower Routine Puzzle in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Gymnast-Tower-Routine-Puzzle/m-p/13030#M1492</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This reminds me of Pascal's Triangle, somewhat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are missing the rest of the puzzle, which requires logging into the website through facebook or linked in:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H3 class="top5"&gt;Puzzle Description&lt;/H3&gt;&lt;P&gt;A gymnast center is designing a tower routine consisting of people standing on top of other’s shoulders. For practical and aesthetic reasons, each person must be both shorter and lighter than the person below him or her.&lt;/P&gt;&lt;P&gt;Given the heights and weights of each person in the event, write a program that computes the largest possible number of people in such a tower routine.&lt;/P&gt;&lt;P&gt;The program accepts a single argument on the command line. This argument is a file name, which contains the information you need (the heights and weights of each person). The program must write to the standard output the largest possible number of people in the tower, followed by a single newline (‘\n’).&lt;/P&gt;&lt;H2&gt;Input Specifications&lt;/H2&gt;&lt;P&gt;The input file consists of a single line.&lt;BR /&gt;The line is made of pairs of heights and weights. Each pair is in the format (ht, wt), with ht and wt both positive integers.&lt;BR /&gt;Each pair is separated by a whitespace. The line might or might not be terminated by a new line ‘\n’.&lt;/P&gt;&lt;P&gt;There are no gymnasts having the same height or same weight.&lt;/P&gt;&lt;P&gt;Here is an example of a valid input: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(15, 176) (65, 97) (72, 43) (102, 6) (191, 189) (90, 163) (44, 168) (39, 47) (123, 37)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H2&gt;Output Specifications&lt;/H2&gt;&lt;P&gt;Your program should output on the standard output the largest possible number of people in the tower, followed by a single newline (‘\n’).&lt;/P&gt;&lt;P&gt;Here is an example of a valid output: &lt;/P&gt;&lt;PRE&gt;4 &lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a test case to make sure your program works:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Input&lt;/P&gt;&lt;P&gt;(9430, 3656) (9147, 14355) (133, 14393) (7917, 9513) (3719, 12775) (9902, 3718) (7613, 46) (7339, 6417) (5034, 7800) (11555, 12870) (14959, 9297) (10707, 4664) (3376, 11162) (12748, 1591) (1299, 4653) (9050, 10847) (4412, 1720) (10030, 1402) (1777, 8625) (12725, 1775)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expected Output&lt;/P&gt;&lt;P&gt;5&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Input&lt;/P&gt;&lt;P&gt;(2850, 1806) (10220, 2971) (5934, 255) (13829, 12522) (9221, 6803) (1643, 8373) (1838, 1330) (5084, 13371) (1874, 2626) (3130, 9037) (4414, 2361) (11327, 1857) (11015, 9180) (10525, 5781) (1172, 10901) (14008, 8653) (5936, 8367) (5407, 6673) (11365, 12291) (6461, 9697) (833, 2632) (13967, 5717) (4363, 7795) (3614, 2924) (7349, 4493) (13674, 2025) (1258, 129) (2478, 14222) (9119, 11612) (2073, 4990)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expected Output&lt;/P&gt;&lt;P&gt;10&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 13 Dec 2011 15:30:28 GMT</pubDate>
    <dc:creator>FriedEgg</dc:creator>
    <dc:date>2011-12-13T15:30:28Z</dc:date>
    <item>
      <title>Gymnast Tower Routine Puzzle</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Gymnast-Tower-Routine-Puzzle/m-p/13029#M1491</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Under influence of FriedEgg , I also want to post a Puzzle. It is from my e-mail.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;URL is &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://www.gild.com/puzzles/details/320"&gt;http://www.gild.com/puzzles/details/320&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I can't understand this Puzzle totally. Is there somebody can explain to me ,it is better to give an example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="black clear"&gt;&lt;STRONG&gt;December&amp;nbsp; 8 - January 15, 2012&lt;/STRONG&gt;&lt;SPAN class="challenge_timezone"&gt;(Closes at 11:59pm GMT)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="top"&gt;A gymnast center is designing a tower routine consisting of people standing on top of other’s shoulders. For practical and aesthetic reasons, each person must be both shorter and lighter than the person below him or her.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Given the heights and weights of each person in the event, write a program that computes the largest possible number of people in such a tower routine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="top bottom size11"&gt;&lt;A class="active_link" href="http://www.gild.com/blog/skills-profile/compare/challenges/rules-terms-of-gild-challenge-contests" target="_blank"&gt;Rules and Terms&lt;/A&gt;&lt;/P&gt;&lt;P class="top bottom size11"&gt;&lt;/P&gt;&lt;P class="top bottom size11"&gt;&lt;/P&gt;&lt;P class="top bottom size11"&gt;&lt;/P&gt;&lt;P class="top bottom size11"&gt;Why it is the largest number not smallest number?&lt;/P&gt;&lt;P class="top bottom size11"&gt;&lt;/P&gt;&lt;P class="top bottom size11"&gt;&lt;/P&gt;&lt;P class="top bottom size11"&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Dec 2011 07:02:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Gymnast-Tower-Routine-Puzzle/m-p/13029#M1491</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-12-13T07:02:16Z</dc:date>
    </item>
    <item>
      <title>Re: Gymnast Tower Routine Puzzle</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Gymnast-Tower-Routine-Puzzle/m-p/13030#M1492</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This reminds me of Pascal's Triangle, somewhat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are missing the rest of the puzzle, which requires logging into the website through facebook or linked in:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H3 class="top5"&gt;Puzzle Description&lt;/H3&gt;&lt;P&gt;A gymnast center is designing a tower routine consisting of people standing on top of other’s shoulders. For practical and aesthetic reasons, each person must be both shorter and lighter than the person below him or her.&lt;/P&gt;&lt;P&gt;Given the heights and weights of each person in the event, write a program that computes the largest possible number of people in such a tower routine.&lt;/P&gt;&lt;P&gt;The program accepts a single argument on the command line. This argument is a file name, which contains the information you need (the heights and weights of each person). The program must write to the standard output the largest possible number of people in the tower, followed by a single newline (‘\n’).&lt;/P&gt;&lt;H2&gt;Input Specifications&lt;/H2&gt;&lt;P&gt;The input file consists of a single line.&lt;BR /&gt;The line is made of pairs of heights and weights. Each pair is in the format (ht, wt), with ht and wt both positive integers.&lt;BR /&gt;Each pair is separated by a whitespace. The line might or might not be terminated by a new line ‘\n’.&lt;/P&gt;&lt;P&gt;There are no gymnasts having the same height or same weight.&lt;/P&gt;&lt;P&gt;Here is an example of a valid input: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(15, 176) (65, 97) (72, 43) (102, 6) (191, 189) (90, 163) (44, 168) (39, 47) (123, 37)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H2&gt;Output Specifications&lt;/H2&gt;&lt;P&gt;Your program should output on the standard output the largest possible number of people in the tower, followed by a single newline (‘\n’).&lt;/P&gt;&lt;P&gt;Here is an example of a valid output: &lt;/P&gt;&lt;PRE&gt;4 &lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a test case to make sure your program works:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Input&lt;/P&gt;&lt;P&gt;(9430, 3656) (9147, 14355) (133, 14393) (7917, 9513) (3719, 12775) (9902, 3718) (7613, 46) (7339, 6417) (5034, 7800) (11555, 12870) (14959, 9297) (10707, 4664) (3376, 11162) (12748, 1591) (1299, 4653) (9050, 10847) (4412, 1720) (10030, 1402) (1777, 8625) (12725, 1775)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expected Output&lt;/P&gt;&lt;P&gt;5&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Input&lt;/P&gt;&lt;P&gt;(2850, 1806) (10220, 2971) (5934, 255) (13829, 12522) (9221, 6803) (1643, 8373) (1838, 1330) (5084, 13371) (1874, 2626) (3130, 9037) (4414, 2361) (11327, 1857) (11015, 9180) (10525, 5781) (1172, 10901) (14008, 8653) (5936, 8367) (5407, 6673) (11365, 12291) (6461, 9697) (833, 2632) (13967, 5717) (4363, 7795) (3614, 2924) (7349, 4493) (13674, 2025) (1258, 129) (2478, 14222) (9119, 11612) (2073, 4990)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Expected Output&lt;/P&gt;&lt;P&gt;10&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Dec 2011 15:30:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Gymnast-Tower-Routine-Puzzle/m-p/13030#M1492</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2011-12-13T15:30:28Z</dc:date>
    </item>
    <item>
      <title>Gymnast Tower Routine Puzzle</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Gymnast-Tower-Routine-Puzzle/m-p/13031#M1493</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is one big issues with the following answer I quickly put together for this problem.&amp;nbsp; ALLPERM has a limit of 18 variables, both of the examples I give above are more than 18, so this will not work for them.&amp;nbsp; However, it does work for the initial question with 9 elements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;filename&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; FT15F001 &lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;temp&lt;/SPAN&gt; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;lrecl&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;=&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;512&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; ht_wt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;infile&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; FT15F001 &lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;dlm&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: purple; font-size: 10pt;"&gt;',)'&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; @;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; _infile_=prxchange(&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: purple; font-size: 10pt;"&gt;'s/[\(\ ]//o'&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;,-&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;,_infile_);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; (ht wt) (:&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;8.&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;) @@;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;parmcards&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffc0; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;(15, 176) (65, 97) (72, 43) (102, 6) (191, 189) (90, 163) (44, 168) (39, 47) (123, 37)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;sql&lt;/STRONG&gt; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;noprint&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;select&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; ht, wt &lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;into&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; :ht separated &lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;by&lt;/SPAN&gt; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: purple; font-size: 10pt;"&gt;' '&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;,:wt separated &lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;by&lt;/SPAN&gt; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: purple; font-size: 10pt;"&gt;' '&lt;/SPAN&gt; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;from&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; ht_wt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;quit&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; _null_;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;array&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; ht[&amp;amp;sqlobs] (&amp;amp;ht);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;array&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; wt[&amp;amp;sqlobs] (&amp;amp;wt);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; count=&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;0&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;do&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; i=&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;to&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; fact(&amp;amp;sqlobs);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;call&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; allperm(i, of ht&lt;LI&gt;);&lt;/LI&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;call&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; allperm(i, of wt&lt;LI&gt;);&lt;/LI&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&amp;nbsp; _count=&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;0&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;do&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; ii=&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;to&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; &amp;amp;sqlobs-&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; ht[ii]&amp;gt;ht[ii+&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;] and wt[ii]&amp;gt;wt[ii+&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;] &lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;then&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; _count+&lt;/SPAN&gt;&lt;STRONG style="color: teal; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;&amp;nbsp; count=max(count,_count);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;file&lt;/SPAN&gt; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;print&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN style="background-color: white; font-family: 'Courier New'; color: blue; font-size: 10pt;"&gt;put&lt;/SPAN&gt;&lt;SPAN style="background-color: white; font-family: 'Courier New'; color: black; font-size: 10pt;"&gt; count;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; font-size: 10pt; background-color: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Dec 2011 17:23:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Gymnast-Tower-Routine-Puzzle/m-p/13031#M1493</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2011-12-13T17:23:58Z</dc:date>
    </item>
    <item>
      <title>Gymnast Tower Routine Puzzle</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Gymnast-Tower-Routine-Puzzle/m-p/13032#M1494</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;I wish I was smart enough to play with you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Dec 2011 18:32:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Gymnast-Tower-Routine-Puzzle/m-p/13032#M1494</guid>
      <dc:creator>Linlin</dc:creator>
      <dc:date>2011-12-13T18:32:14Z</dc:date>
    </item>
    <item>
      <title>Re: Gymnast Tower Routine Puzzle</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Gymnast-Tower-Routine-Puzzle/m-p/13033#M1495</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Haha. I understood what the puzzle means. I can code it correctly now.&lt;/P&gt;&lt;P&gt;Fried Egg , It is not sensible method to use call perm which will waste lots of System Source ,because it might be yield a loop(i.e. you will search the track you have already searched.)&lt;/P&gt;&lt;P&gt;Now I will post my code to GLID to Win My ipad. &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;Hope I can register at it. But Chinese Government has already forbidden FaceBook , Twitter .... and so on.&lt;/P&gt;&lt;P&gt;I am not sure I can get a right to post.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;/*The following is SAS code. it is passed under SAS9.2*/
/*input can change under datalines, output will be generated in SAS log */


data have;
infile datalines dlm='(), ';
input height weight @@;
datalines;
(2850, 1806) (10220, 2971) (5934, 255) (13829, 12522) (9221, 6803) (1643, 8373) (1838, 1330) (5084, 13371) (1874, 2626) (3130, 9037) (4414, 2361) (11327, 1857) (11015, 9180) (10525, 5781) (1172, 10901) (14008, 8653) (5936, 8367) (5407, 6673) (11365, 12291) (6461, 9697) (833, 2632) (13967, 5717) (4363, 7795) (3614, 2924) (7349, 4493) (13674, 2025) (1258, 129) (2478, 14222) (9119, 11612) (2073, 4990)
;
run;



data _null_;
if _n_ eq 1 then do;
if 0 then set have;
declare hash ha(dataset:'have');
declare hiter hi('ha');
 ha.definekey('height','weight');
 ha.definedata('height','weight');
 ha.definedone();

length obs 8 branch _branch $ 20000;
declare hash h(hashexp:20,ordered:'Y');
declare hiter i('h');
 h.definekey('obs');
 h.definedata('branch');
 h.definedone();
end;
set have end=last;&amp;nbsp; retain max 0;
count+1;obs=1;branch=catx('|',height,weight);h.add();
do while(i.next()=0);&amp;nbsp; num=(countc(branch,'|')+1)/2;
 max=max(max,num);
_height=input(scan(branch,-2,'|'),best8.);
_weight=input(scan(branch,-1,'|'),best8.);
 do while(hi.next()=0);
&amp;nbsp; _branch=branch;
&amp;nbsp; if _height lt height and _weight lt weight then do;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; obs+1;branch=catx('|',branch,height,weight);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; h.add();branch=_branch;end;
 end;
end;
h.clear();
if last then putlog 'The largest possible number is : ' max&amp;nbsp; ;
run;



&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: xia keshan ______ A fixed Version.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Dec 2011 03:08:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Gymnast-Tower-Routine-Puzzle/m-p/13033#M1495</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-12-14T03:08:59Z</dc:date>
    </item>
    <item>
      <title>Gymnast Tower Routine Puzzle</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Gymnast-Tower-Routine-Puzzle/m-p/13034#M1496</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your post. Linlin .&lt;/P&gt;&lt;P&gt;I have already send my resume to Mr. Jason.&lt;/P&gt;&lt;P&gt;But I am not sure whether they are interesting with a foreigner.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Dec 2011 03:11:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Gymnast-Tower-Routine-Puzzle/m-p/13034#M1496</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-12-14T03:11:28Z</dc:date>
    </item>
    <item>
      <title>Gymnast Tower Routine Puzzle</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Gymnast-Tower-Routine-Puzzle/m-p/13035#M1497</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Nice work Ksharp.&amp;nbsp; As I mentioned in my original post my code was not good.&amp;nbsp; It was a quick, brute-force type, not even fully working since it has a hard limit on number of variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortuneatly gild.com and codeeval.com and most other sites I know of similar do not accept SAS language solutions. &lt;img id="smileysad" class="emoticon emoticon-smileysad" src="https://communities.sas.com/i/smilies/16x16_smiley-sad.png" alt="Smiley Sad" title="Smiley Sad" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Dec 2011 17:13:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Gymnast-Tower-Routine-Puzzle/m-p/13035#M1497</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2011-12-14T17:13:01Z</dc:date>
    </item>
    <item>
      <title>Gymnast Tower Routine Puzzle</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Gymnast-Tower-Routine-Puzzle/m-p/13036#M1498</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi. FriedEgg.&lt;/P&gt;&lt;P&gt;I found my code above is not efficient. So I recode and optimize it.&lt;/P&gt;&lt;P&gt;As your said . When I intend to post my code to Gild, I can't find a place for SAS, there are many language Java C Rubby Perl, only not include SAS. I can't own my Ipad. &lt;img id="smileysad" class="emoticon emoticon-smileysad" src="https://communities.sas.com/i/smilies/16x16_smiley-sad.png" alt="Smiley Sad" title="Smiley Sad" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;data have;
infile datalines dlm='(), ';
input height weight @@;
datalines;
(2850, 1806) (10220, 2971) (5934, 255) (13829, 12522) (9221, 6803) (1643, 8373) (1838, 1330) (5084, 13371) (1874, 2626) (3130, 9037) (4414, 2361) (11327, 1857) (11015, 9180) (10525, 5781) (1172, 10901) (14008, 8653) (5936, 8367) (5407, 6673) (11365, 12291) (6461, 9697) (833, 2632) (13967, 5717) (4363, 7795) (3614, 2924) (7349, 4493) (13674, 2025) (1258, 129) (2478, 14222) (9119, 11612) (2073, 4990)
;
run;


data _null_;
if _n_ eq 1 then do;
if 0 then set have;
declare hash ha(dataset:'have');
declare hiter hi('ha');
 ha.definekey('height','weight');
 ha.definedata('height','weight');
 ha.definedone();

length obs _height _weight person _person __height __weight 8;
declare hash h(ordered:'Y');
declare hiter i('h');
 h.definekey('obs');
 h.definedata('_height','_weight','_person');
 h.definedone();
end;
set have end=last;&amp;nbsp; retain max 0;
obs=1; _person=1; _height=height; _weight=weight; h.add();
do while(i.next()=0); 
 max=max(max,_person); person=_person;__height=_height;__weight=_weight;
 do while(hi.next()=0);
&amp;nbsp; if _height lt height and _weight lt weight then do;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; obs+1;_person+1;_height=height;_weight=weight;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; h.add();_person=person;_height=__height;_weight=__weight;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;
 end;
end;
h.clear();
if last then putlog 'The largest possible number is : ' max&amp;nbsp; ;
run;



&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Dec 2011 02:31:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Gymnast-Tower-Routine-Puzzle/m-p/13036#M1498</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-12-15T02:31:53Z</dc:date>
    </item>
  </channel>
</rss>

