The number is 16. The value is 16. The answer is 0. If value is more than 0, set answer to 1.
Repeat while value is more than 1.
The remainder is value modulo 2. If remainder is not 0, set answer to 0. Set value to value divided by 2.
If answer is 1, show true, otherwise show false.
The limit is 13. Keep a shared total of 0.
For every number from 1 to limit.
The value is number.
Repeat while value is more than 0.
The digit is value modulo 10. If digit is 1, add 1 to total. Set value to value divided by 10.
Show total.
The numbers is a list of 1, 2, 2, and 1. The left is 0. The right is the last position of numbers. The answer is 1.
Repeat while left is less than right.
If item left of numbers is not item right of numbers, set answer to 0. Add 1 to left. Decrease right by 1.
If answer is 1, show true, otherwise show false.
Keep a shared values holding 6, 2, 8, 0, 4, 7, 9, 3, and 5. Keep a shared lefts holding 1, 3, 7, 9, -1, 5, 6, -1, and -1. Keep a shared rights holding 2, 4, 8, 10, -1, -1, -1, -1, and -1. The current is 0. The answer is 0. Set answer to -1.
Repeat while answer is -1.
The here is item current of values. The left is item current of lefts. The right is item current of rights. If here is more than 8, set current to left. If here is less than 2, set current to right. If here is at least 2 and here is at most 8, set answer to here.
Show answer.
Keep a shared values holding 3, 5, 1, 6, 2, 0, 8, 7, and 4. Keep a shared lefts holding 1, 3, 5, -1, 7, -1, -1, -1, and -1. Keep a shared rights holding 2, 4, 6, -1, 8, -1, -1, -1, and -1. The last is 8. The parents is a list of 9 zeros. Set item 0 of parents to -1. The queue is an empty list of whole numbers. Place 0 into queue. The head is 0. The count is 1.
Repeat while head is less than count.
The node is item head of queue. Add 1 to head. The left is item node of lefts. The right is item node of rights. If left is at least 0, Place left into queue, add 1 to count, set item left of parents to node. If right is at least 0, Place right into queue, add 1 to count, set item right of parents to node.
The firstnode is 0. The secondnode is 0.
For every spot from 0 to last.
If item spot of values is 5, set firstnode to spot. If item spot of values is 1, set secondnode to spot.
The marks is a list of 9 zeros. The walker is firstnode.
Repeat while walker is at least 0.
Set item walker of marks to 1. Set walker to item walker of parents.
The seeker is secondnode.
Repeat while item seeker of marks is 0.
Set seeker to item seeker of parents.
Show item seeker of values.
The numbers is a list of 4, 5, 1, and 9. The last is the last position of numbers. The target is 0. The found is 0.
For every spot from 0 to last.
If found is 0 and item spot of numbers is 5, set target to spot, set found to 1.
The head is target. The end is last minus 1.
For every spot from head to end.
Set item spot of numbers to item (spot plus 1) of numbers.
remove the last item from numbers. For each value in numbers, show value.
Keep a shared numbers holding 1, 2, 3, and 4. Keep a shared last of 3. Keep a shared product of 0.
To multiply from target (a whole number). Set product to 1.
For every other from 0 to last.
If other is not target, set product to product times item other of numbers.
The answer is an empty list of whole numbers.
For every slot from 0 to 3.
Place 0 into answer.
For every spot from 0 to last.
Multiply from spot. Set item spot of answer to product.
For each value in answer, show value.
Keep a shared numbers holding 1, 3, -1, -3, 5, 3, 6, and 7. Keep a shared last of 7. Keep a shared best of 0.
To scan from target (a whole number) with width (a whole number). Set best to item target of numbers. The final is target plus width minus 1.
For every offset from target to final.
The value is item offset of numbers. If value is more than best, set best to value.
The limit is last minus 2.
For every start from 0 to limit.
Scan from start with 3. Show best.
The matrix is a list of 1, 4, 7, 11, 15, 2, 5, 8, 12, 19, 3, 6, 9, 16, 22, 10, 13, 14, 17, 24, 18, 21, 23, 26, and 30. The target is 5. The row is 0. The column is 4. The found is 0.
Repeat while row is less than 5 and column is at least 0 and found is 0.
The cell is row times 5 plus column. The value is item cell of matrix. If value is target, set found to 1. If value is more than target, set column to column minus 1. If value is less than target, set row to row plus 1.
If found is 1, show true, otherwise show false.
The expression is "2-1-1". Keep a shared numbers as an empty list of whole numbers. Keep a shared opercodes as an empty list of whole numbers. Keep a shared table as an empty list of whole numbers. Keep a shared counts as an empty list of whole numbers. Keep a shared capacity of 4. Keep a shared width of 3. The number is 0. The last is the last position of expression.
For every spot from 0 to last.
The symbol is character spot of expression. If symbol is between "0" and "9", The digit is the digit value of symbol, set number to number times 10 plus digit. If symbol is "+", Place number into numbers, Place 1 into opercodes, set number to 0. If symbol is "-", Place number into numbers, Place 2 into opercodes, set number to 0. If symbol is "*", Place number into numbers, Place 3 into opercodes, set number to 0.
Place number into numbers.
For every slot from 0 to 35.
Place 0 into table.
For every slot from 0 to 8.
Place 0 into counts.
To solve from start (a whole number) with finish (a whole number). The cell is start times width plus finish. If start is finish, set item cell of counts to 1, set item (cell times capacity) of table to item start of numbers, return. Set item cell of counts to 0. The splitlast is finish minus 1.
For every split from start to splitlast.
Solve from start with split. Solve from split plus 1 with finish. The leftcell is start times width plus split. The rightcell is (split plus 1) times width plus finish. The leftcount is item leftcell of counts. The rightcount is item rightcell of counts. The oper is item split of opercodes. The leftlast is leftcount minus 1.
For every leftslot from 0 to leftlast.
The leftvalue is item (leftcell times capacity plus leftslot) of table. The rightlast is rightcount minus 1.
For every rightslot from 0 to rightlast.
The rightvalue is item (rightcell times capacity plus rightslot) of table. The value is 0. If oper is 1, set value to leftvalue plus rightvalue. If oper is 2, set value to leftvalue minus rightvalue. If oper is 3, set value to leftvalue times rightvalue. The slotindex is item cell of counts. The spot is cell times capacity plus slotindex. Set item spot of table to value. Set item cell of counts to slotindex plus 1.
Solve from 0 with 2. The finalcell is 2. The total is item finalcell of counts. The answers is an empty list of whole numbers. The lastslot is total minus 1.
For every slot from 0 to lastslot.
The answer is item (finalcell times capacity plus slot) of table. Place answer into answers.
Sort answers. For each answer in answers, show answer.
Keep a shared first as empty text. Place "anagram" into first. Keep a shared second as empty text. Place "nagaram" into second. Keep a shared last of 6. Keep a shared countfirst of 0. Keep a shared countsecond of 0. Keep a shared answer of 1.
To tally from target (a whole number). Set countfirst to 0. Set countsecond to 0.
For every other from 0 to last.
The leftletter is character other of first. The rightletter is character target of first. The otherletter is character other of second. If leftletter is rightletter, add 1 to countfirst. If otherletter is rightletter, add 1 to countsecond.
For every spot from 0 to last.
Tally from spot. If countfirst is not countsecond, set answer to 0.
If answer is 1, show true, otherwise show false.
Keep a shared values holding 1, 2, 3, and 5. Keep a shared lefts holding 1, -1, -1, and -1. Keep a shared rights holding 2, 3, -1, and -1. Keep a shared path as an empty list of whole numbers. Keep a shared answers as an empty list of text. Keep a shared line as empty text.
To render from spot (a whole number) with last (a whole number). If spot is more than last, return. If spot is more than 0, Place "->" into line. The piece is format whole number item spot of path as text. Place piece into line. Render from spot plus 1 with last.
To store answer. Set line to empty text. The lastpath is the last position of path. Render from 0 with lastpath. The copy is a copy of line. Place copy into answers.
To walk from node (a whole number). If node is less than 0, return. Place item node of values into path. The left is item node of lefts. The right is item node of rights. If left is -1 and right is -1, store answer. If left is at least 0, walk from left. If right is at least 0, walk from right. Remove the last item from path.
Walk from 0. For each answer in answers, show answer.
Keep a shared result of 0.
To gather from value (a whole number) with total (a whole number). If value is 0, set result to total, return. Gather from value divided by 10 with total plus value modulo 10.
The number is 38. The value is number.
Repeat while value is at least 10.
Gather from value with 0. Set value to result.
Show value.
Keep a shared numbers holding 1, 2, 1, 3, 2, and 5. Keep a shared seek of 0. Keep a shared tally of 0. Keep a shared answers as an empty list of whole numbers.
To gather from spot (a whole number) with last (a whole number). If spot is more than last, return. If item spot of numbers is seek, add 1 to tally. Gather from spot plus 1 with last.
For every spot from 0 to 5.
Set seek to item spot of numbers. Set tally to 0. Gather from 0 with 5. If tally is 1, Place seek into answers.
Sort answers. For each value in answers, show value.
The number is 6. The value is number.
Repeat while value modulo 2 is 0.
Set value to value divided by 2.
Repeat while value modulo 3 is 0.
Set value to value divided by 3.
Repeat while value modulo 5 is 0.
Set value to value divided by 5.
If value is 1, show true, otherwise show false.
Keep a shared ugly of 0.
To test from value (a whole number). If value is 1, set ugly to 1, return. If value modulo 2 is 0, test from value divided by 2, return. If value modulo 3 is 0, test from value divided by 3, return. If value modulo 5 is 0, test from value divided by 5, return.
The want is 10. The count is 0. The candidate is 0.
Repeat while count is less than want.
Add 1 to candidate. Set ugly to 0. Test from candidate. If ugly is 1, add 1 to count.
Show candidate.
The numbers is a list of 3, 0, and 1. The last is the last position of numbers. The size is last plus 1. The total is 0.
For each value in numbers.
Add value to total.
The expected is size times (size plus 1) divided by 2. Show expected minus total.
Keep a shared ones holding "Zero", "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Eleven", "Twelve", "Thirteen", "Fourteen", "Fifteen", "Sixteen", "Seventeen", "Eighteen", and "Nineteen". Keep a shared tens holding "Twenty", "Thirty", "Forty", "Fifty", "Sixty", "Seventy", "Eighty", and "Ninety". Keep a shared part as empty text.
To render from value (a whole number). The hundreds is value divided by 100. If value is at least 100, Place item hundreds of ones into part, Place " Hundred" into part. Set value to value modulo 100. If value is 0, return. If value is more than 0 and hundreds is more than 0, Place " " into part. If value is less than 20, Place item value of ones into part, return. The tensdigit is value divided by 10. Place item (tensdigit minus 2) of tens into part. The digit is value modulo 10. If digit is more than 0, Place " " into part, Place item digit of ones into part.
The number is 123. The value is number. The billions is value divided by 1000000000. If value is at least 1000000000, render from billions, Place " Billion" into part, set value to value modulo 1000000000. The millions is value divided by 1000000. If value is at least 1000000 and the length of part is more than 0, Place " " into part. If value is at least 1000000, render from millions, Place " Million" into part, set value to value modulo 1000000. The thousands is value divided by 1000. If value is at least 1000 and the length of part is more than 0, Place " " into part. If value is at least 1000, render from thousands, Place " Thousand" into part, set value to value modulo 1000. If value is more than 0 and the length of part is more than 0, Place " " into part. If value is more than 0, render from value. If number is 0, Place "Zero" into part.
Show part.
Keep a shared numbers holding 3, 0, 6, 1, and 5. Keep a shared seek of 0. Keep a shared tally of 0.
To gather from spot (a whole number) with last (a whole number). If spot is more than last, return. If item spot of numbers is at least seek, add 1 to tally. Gather from spot plus 1 with last.
The best is 0.
For every level from 0 to 5.
Set seek to level. Set tally to 0. Gather from 0 with 4. If tally is at least level, set best to level.
Show best.
Keep a shared numbers holding 0, 1, 3, 5, and 6. Keep a shared seek of 0. Keep a shared tally of 0.
To gather from spot (a whole number) with last (a whole number). If spot is more than last, return. If item spot of numbers is at least seek, add 1 to tally. Gather from spot plus 1 with last.
The best is 0.
For every level from 0 to 4.
Set seek to level. Set tally to 0. Gather from 0 with 4. If tally is at least level, set best to level.
Show best.
Keep a shared dp as an empty list of whole numbers.
For every spot from 0 to 12.
Place 0 into dp.
Keep a shared best of 0.
To test from value (a whole number) with step (a whole number). The square is step times step. If square is more than value, return. The trial is item (value minus square) of dp plus 1. If trial is less than best, set best to trial. Test from value with step plus 1.
The number is 12.
For every value from 1 to 12.
Set best to 1000000. Test from value with 1. Set item value of dp to best.
Show item 12 of dp.
Keep a shared source as empty text. Place "123" into source. Keep a shared parts as an empty list of text. Keep a shared answers as an empty list of text. Keep a shared target of 0. Keep a shared lastposition of 0. Keep a shared currenttotal of 0. Keep a shared lastoperand of 0. Keep a shared operand of 0. Keep a shared part as empty text.
To store answer. If currenttotal is not target, return. The expression is join parts with "". The copy is a copy of expression. Place copy into answers.
To extend from end (a whole number) with code (a whole number). The value is operand. The savetotal is currenttotal. The savelast is lastoperand. Set part to empty text. If code is 0, Place "+" into part. If code is 1, Place "-" into part. If code is 2, Place "*" into part. Place format whole number value as text into part. Place part into parts. If code is 0, set currenttotal to currenttotal plus value. If code is 1, set currenttotal to currenttotal minus value. If code is 2, set lastoperand to lastoperand times value. If code is 2, set currenttotal to currenttotal minus savelast plus lastoperand. Search from end. Set currenttotal to savetotal. Set lastoperand to savelast. Remove the last item from parts.
To search from start (a whole number). If start is more than lastposition, store answer, return. The value is 0.
For every end from start to lastposition.
The digit is the digit value of character end of source. Set value to value times 10 plus digit. If start is less than end and character start of source is "0", break. Set operand to value. If start is 0, carry from end. If start is not 0, set operand to value. If start is not 0, extend from end plus 1 with 0. If start is not 0, set operand to value. If start is not 0, extend from end plus 1 with 1. If start is not 0, set operand to value. If start is not 0, extend from end plus 1 with 2.
To carry from end (a whole number). The value is operand. The piece is format whole number value as text. Place piece into parts. Set currenttotal to value. Set lastoperand to value. Search from end plus 1. Remove the last item from parts.
Set target to 6. Set lastposition to 2. Search from 0. For each answer in answers, show answer.
The numbers is a list of 0, 1, 0, 3, and 12. The result is an empty list of whole numbers. The zeros is 0.
For each value in numbers.
If value is not 0, Place value into result. If value is 0, add 1 to zeros.
Repeat while zeros is more than 0.
Place 0 into result. Subtract 1 from zeros.
For each value in result, show value.
Keep a shared numbers holding 1, 3, 4, 2, and 2. Keep a shared seek of 0. Keep a shared tally of 0.
To gather from spot (a whole number) with last (a whole number). If spot is more than last, return. If item spot of numbers is seek, add 1 to tally. Gather from spot plus 1 with last.
The duplicate is 0.
For every spot from 0 to 4.
Set seek to item spot of numbers. Set tally to 0. Gather from 0 with spot minus 1. If tally is more than 0, set duplicate to seek.
Show duplicate.
Keep a shared board holding 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, and 0. Keep a shared rowsteps holding -1, -1, -1, 0, 0, 1, 1, and 1. Keep a shared colsteps holding -1, 0, 1, -1, 1, -1, 0, and 1. Keep a shared neighbors of 0.
To count from row (a whole number) with column (a whole number). Set neighbors to 0.
For every step from 0 to 7.
The r is row plus item step of rowsteps. The c is column plus item step of colsteps. If r is at least 0 and r is less than 4 and c is at least 0 and c is less than 3 and item (r times 3 plus c) of board is 1, add 1 to neighbors.
The future is a list of 12 zeros.
For every cell from 0 to 11.
The row is cell divided by 3. The column is cell modulo 3. Count from row with column. The live is item cell of board. The nextvalue is 0. If live is 1 and neighbors is at least 2 and neighbors is at most 3, set nextvalue to 1. If live is 1 and neighbors is less than 2, set nextvalue to 0. If live is 1 and neighbors is more than 3, set nextvalue to 0. If live is 0 and neighbors is 3, set nextvalue to 1. Set item cell of future to nextvalue.
For each value in future, show value.
The pattern is "abba". The source is "dog cat cat dog". The pieces is split source by " ". Keep a shared words as an empty list of text.
For each piece in pieces.
Place piece into words.
Keep a shared keys as an empty list of text. Keep a shared values as an empty list of text. Keep a shared seek as empty text. Keep a shared found of 0. Keep a shared used of 0. Keep a shared same of 0. Keep a shared letter as empty text.
To locate from spot (a whole number) with last (a whole number). If spot is more than last, return. If item spot of keys matches letter, set found to spot, return. Locate from spot plus 1 with last.
To check from spot (a whole number). If item spot of values does not match seek, set same to 0.
To search from spot (a whole number) with last (a whole number). If spot is more than last, return. If item spot of values matches seek, set used to 1, return. Search from spot plus 1 with last.
The length is the number of characters in pattern. The count is the number of items in words. The good is 1. If length is not count, set good to 0.
If length is count.
For every spot from 0 to 3.
The symbol is character spot of pattern. Set letter to empty text. Place symbol into letter. Set seek to item spot of words. Set found to -1. The keylast is the last position of keys. Locate from 0 with keylast. Set same to 1. If found is at least 0, check from found. If found is at least 0 and same is 0, set good to 0. If found is -1, set used to 0. The valuelast is the last position of values. If found is -1, search from 0 with valuelast. If found is -1 and used is 1, set good to 0. If found is -1 and used is 0, Place letter into keys, Place seek into values.
If good is 1, show true, otherwise show false.
Keep a shared secret as empty text. Place "1807" into secret. Keep a shared guess as empty text. Place "7810" into guess. Keep a shared usedsecret as an empty list of whole numbers. Keep a shared usedguess as an empty list of whole numbers.
For every spot from 0 to 3.
Place 0 into usedsecret. Place 0 into usedguess.
Keep a shared bulls of 0. Keep a shared cows of 0. Keep a shared targetchar of 0. Keep a shared cowfound of 0.
For every spot from 0 to 3.
If character spot of secret is character spot of guess, add 1 to bulls, set item spot of usedsecret to 1, set item spot of usedguess to 1.
To find from spot (a whole number) with last (a whole number). If spot is more than last, return. If item spot of usedguess is 1, find from spot plus 1 with last, return. If character spot of guess is targetchar, set item spot of usedguess to 1, set cowfound to 1, return. Find from spot plus 1 with last.
For every spot from 0 to 3.
If item spot of usedsecret is 0.
Set targetchar to character spot of secret. Set cowfound to 0. Find from 0 with 3. If cowfound is 1, add 1 to cows, set item spot of usedsecret to 1.
The firstpart is format whole number bulls as text. The secondpart is format whole number cows as text. The result is empty text. Place firstpart into result. Place "A" into result. Place secondpart into result. Place "B" into result. Show result.
Keep a shared numbers holding 10, 9, 2, 5, 3, 7, 101, and 18. Keep a shared dp as an empty list of whole numbers.
For every spot from 0 to 7.
Place 1 into dp.
Keep a shared best of 0.
To extend from spot (a whole number) with before (a whole number). If before is at least spot, return. If item before of numbers is less than item spot of numbers and item before of dp plus 1 is more than best, set best to item before of dp plus 1. Extend from spot with before plus 1.
For every spot from 1 to 7.
Set best to 1. Extend from spot with 0. Set item spot of dp to best.
The answer is 1.
For each value in dp.
If value is more than answer, set answer to value.
Show answer.
Keep a shared source as empty text. Keep a shared candidate as empty text. Keep a shared probe as empty text. Keep a shared answers as an empty list of text. Keep a shared balance of 0. Keep a shared good of 0. Keep a shared duplicate of 0. Keep a shared best of 0. Keep a shared bits of 0. Keep a shared need of 0. Place "()())()" into source. Set best to -1.
To build from mask (a whole number) with spot (a whole number). If spot is more than 6, return. The raised is shift 1 left by spot. The bit is bitwise and of mask and raised. If bit is more than 0, appendchar from spot. Build from mask with spot plus 1.
To appendchar from spot (a whole number). The piece is the slice of source from spot to spot plus 1. Place piece into candidate.
To check from spot (a whole number). If spot is more than the last position of candidate, return. The piece is the slice of candidate from spot to spot plus 1. If piece matches "(", add 1 to balance. If piece matches ")", subtract 1 from balance. If balance is less than 0, set good to 0. Check from spot plus 1.
To count from mask (a whole number) with spot (a whole number). If spot is more than 6, return. The raised is shift 1 left by spot. The bit is bitwise and of mask and raised. If bit is more than 0, add 1 to bits. Count from mask with spot plus 1.
To look from spot (a whole number). If spot is more than the last position of answers, return. If item spot of answers matches probe, set duplicate to 1, return. Look from spot plus 1.
For every spot from 0 to 6.
The piece is the slice of source from spot to spot plus 1. If piece matches "(", add 1 to balance. If piece matches ")", subtract 1 from balance. If balance is less than 0, set balance to 0, add 1 to need.
Increase need by balance. The keepcount is 7 minus need.
For every mask from 0 to 127.
Set bits to 0. Count from mask with 0.
If bits is keepcount.
Set candidate to empty text. Build from mask with 0. Set balance to 0. Set good to 1. Check from 0.
If good is 1 and balance is 0.
The length is the last position of candidate. If length is more than best, set best to length.
For every mask from 0 to 127.
Set bits to 0. Count from mask with 0.
If bits is keepcount.
Set candidate to empty text. Build from mask with 0. Set balance to 0. Set good to 1. Check from 0.
If good is 1 and balance is 0.
The length is the last position of candidate.
If length is best.
Set duplicate to 0. Set probe to empty text. Place candidate into probe. Look from 0. If duplicate is 0, The copy is a copy of candidate, Place copy into answers.
The lastanswer is the last position of answers.
For every left from 0 to lastanswer.
For every right from left to lastanswer.
If item right of answers comes before item left of answers, swap item left of answers and item right of answers.
For each answer in answers, show answer.
Keep a shared source as empty text. Keep a shared parsed of 0. Keep a shared valid of 0. Place "112358" into source.
To parse from spot (a whole number) with finish (a whole number). If spot is more than finish, return. The digit is the digit value of character spot of source. Set parsed to parsed times 10 plus digit. Parse from spot plus 1 with finish.
To follow from position (a whole number) with before (a whole number) and previous (a whole number). If position is more than the last position of source, set valid to 1, return. The sum is before plus previous. The piece is format whole number sum as text. The size is the last position of piece. The finish is position plus size. If finish is more than the last position of source, return. Set parsed to 0. Parse from position with finish. The nextvalue is parsed. If nextvalue is not sum, return. Follow from finish plus 1 with previous and nextvalue.
For every firstsize from 1 to 4.
For every secondsize from 1 to 4.
If firstsize plus secondsize is at most 5 and valid is 0.
Set parsed to 0. Parse from 0 with firstsize minus 1. The firstnumber is parsed. The secondstart is firstsize. The secondend is firstsize plus secondsize minus 1. Set parsed to 0. Parse from secondstart with secondend. The secondnumber is parsed. Follow from secondend plus 1 with firstnumber and secondnumber.
If valid is 1, show true, otherwise show false.
The prices is a list of 1, 2, 3, 0, and 2. The last is the last position of prices. The holding is -1000000. The sold is 0. The resting is 0.
For every spot from 0 to last.
The price is item spot of prices. The oldholding is holding. The oldsold is sold. The oldresting is resting. The buying is oldresting minus price. If buying is more than oldholding, set holding to buying, otherwise set holding to oldholding. Set sold to oldholding plus price. If oldsold is more than oldresting, set resting to oldsold, otherwise set resting to oldresting.
If sold is more than resting, show sold, otherwise show resting.
Keep a shared matrix as empty list of whole numbers. Keep a shared deepest of 0.
For every spot from 0 to 15.
Place 0 into matrix.
Set item 4 of matrix to 1. Set item 1 of matrix to 1. Set item 6 of matrix to 1. Set item 9 of matrix to 1. Set item 7 of matrix to 1. Set item 13 of matrix to 1. The heights is a list of 4 zeros.
To walk from node (a whole number) with parent (a whole number) and depth (a whole number). If depth is more than deepest, set deepest to depth.
For every other from 0 to 3.
The at is node times 4 plus other.
If item at of matrix is 1 and other is not parent.
Walk from other with node and depth plus 1.
For every root from 0 to 3.
Set deepest to 0. Walk from root with -1 and 0. Set item root of heights to deepest.
The best is item 0 of heights.
For every root from 1 to 3.
If item root of heights is less than best, set best to item root of heights.
For every root from 0 to 3.
If item root of heights is best, show root.
Keep a shared values as an empty list of whole numbers. Keep a shared memo as an empty list of whole numbers. The numbers is a list of 3, 1, 5, and 8. Place 1 into values.
For every spot from 0 to 3.
Place item spot of numbers into values.
Place 1 into values.
For every spot from 0 to 35.
Place -1 into memo.
To burst from left (a whole number) with right (a whole number). The slot is left times 6 plus right. If item slot of memo is at least 0, return. If right minus left is less than 2, set item slot of memo to 0, return. Set item slot of memo to 0.
For every spot from left plus 1 to right minus 1.
Burst from left with spot. Burst from spot with right. The first is item (left times 6 plus spot) of memo. The second is item (spot times 6 plus right) of memo. The gain is item left of values times item spot of values times item right of values. The candidate is gain plus first plus second. If candidate is more than item slot of memo, set item slot of memo to candidate.
Burst from 0 with 5. Show item 5 of memo.
Keep a shared nexts as an empty list of whole numbers. Keep a shared smallest of 0. The primes is a list of 2, 7, 13, and 19. The ugly is an empty list of whole numbers. Place 1 into ugly. The markers is a list of 4 zeros.
For every spot from 0 to 3.
Place item spot of primes into nexts.
To find from spot (a whole number) with limit (a whole number). If spot is more than limit, return. If item spot of nexts is less than smallest, set smallest to item spot of nexts. Find from spot plus 1 with limit.
For every count from 1 to 11.
Set smallest to item 0 of nexts. Find from 1 with 3. Place smallest into ugly.
For every spot from 0 to 3.
If item spot of nexts is smallest.
The marker is item spot of markers. Set item spot of markers to marker plus 1. The product is item (marker plus 1) of ugly times item spot of primes. Set item spot of nexts to product.
Show item 11 of ugly.
Keep a shared numbers as an empty list of whole numbers. Keep a shared counts as an empty list of whole numbers. Place 5 into numbers. Place 2 into numbers. Place 6 into numbers. Place 1 into numbers.
For every spot from 0 to 3.
Place 0 into counts.
To scan from outer (a whole number) with inner (a whole number). If inner is more than 3, return. If item inner of numbers is less than item outer of numbers, set item outer of counts to item outer of counts plus 1. Scan from outer with inner plus 1.
For every outer from 0 to 3.
Scan from outer with outer plus 1.
The line is empty text.
For every spot from 0 to 3.
If spot is more than 0, Place "," into line. The piece is format whole number item spot of counts as text. Place piece into line.
Show line.
Keep a shared source as empty text. Keep a shared alphabet as empty text. Keep a shared symbol as empty text. Keep a shared picked as empty text. Keep a shared stack as empty text. Keep a shared lasts as empty list of whole numbers. Keep a shared used as empty list of whole numbers. Keep a shared position of 0. Keep a shared marks as an empty list of whole numbers. Place 0 into marks. Place "bcabc" into source. Place "abcdefghijklmnopqrstuvwxyz" into alphabet.
For every spot from 0 to 25.
Place 0 into lasts. Place 0 into used.
To locate from spot (a whole number). If spot is more than 25, return. The letter is the slice of alphabet from spot to spot plus 1. If letter matches symbol, set position to spot, return. Locate from spot plus 1.
To settle from spot (a whole number). If the length of stack is less than 1, Place picked into stack, set item (item 0 of marks) of used to 1, return. The topstart is the last position of stack. The topfinish is topstart plus 1. The top is the slice of stack from topstart to topfinish. Set symbol to empty text. Place top into symbol. Locate from 0. The topindex is position. The can is 0. If item topindex of lasts is more than spot, set can to 1. If symbol comes before picked, set can to 0. If can is 0, Place picked into stack, set item (item 0 of marks) of used to 1, return. Remove last character from stack. Set item topindex of used to 0. Settle from spot.
For every spot from 0 to 4.
The piece is the slice of source from spot to spot plus 1. Set symbol to empty text. Place piece into symbol. Locate from 0. Set item position of lasts to spot.
For every spot from 0 to 4.
The piece is the slice of source from spot to spot plus 1. Set symbol to empty text. Place piece into symbol. Locate from 0. Set item 0 of marks to position. Set picked to empty text. Place piece into picked. If item (item 0 of marks) of used is 0, settle from spot.
Show stack.
Keep a shared words as an empty list of text. Keep a shared masks as an empty list of whole numbers. Keep a shared sizes as an empty list of whole numbers. Keep a shared alphabet as empty text. Keep a shared symbol as empty text. Keep a shared position of 0. Place "abcw" into words. Place "baz" into words. Place "foo" into words. Place "bar" into words. Place "xtfn" into words. Place "abcdef" into words. Place "abcdefghijklmnopqrstuvwxyz" into alphabet.
For every spot from 0 to 5.
Place 0 into masks. Place 0 into sizes.
To locate from spot (a whole number). If spot is more than 25, return. The letter is the slice of alphabet from spot to spot plus 1. If letter matches symbol, set position to spot, return. Locate from spot plus 1.
To mark from index (a whole number) with spot (a whole number). If spot is at least item index of sizes, return. The word is item index of words. The piece is the slice of word from spot to spot plus 1. Set symbol to empty text. Place piece into symbol. Locate from 0. The raised is shift 1 left by position. The mixed is bitwise or of item index of masks and raised. Set item index of masks to mixed. Mark from index with spot plus 1.
To encode from index (a whole number). If index is more than 5, return. The word is item index of words. The size is the last position of word. Set item index of sizes to size plus 1. Mark from index with 0. Encode from index plus 1.
Encode from 0. The best is 0.
For every left from 0 to 5.
For every right from left plus 1 to 5.
The common is bitwise and of item left of masks and item right of masks.
If common is 0.
The product is item left of sizes times item right of sizes. If product is more than best, set best to product.
Show best.
Keep a shared pool as an empty list of whole numbers. Keep a shared candidate as empty text. Keep a shared bestsub as empty text. Keep a shared lefttext as empty text. Keep a shared righttext as empty text. Keep a shared mixed as empty text. Keep a shared bestmixed as empty text. Keep a shared overall as empty text. Keep a shared picklo of 0. Keep a shared pickhi of 0. Keep a shared pickmask of 0. Keep a shared started of 0. Keep a shared improve of 0. Keep a shared bestmask of 0. Place 3 into pool. Place 4 into pool. Place 6 into pool. Place 5 into pool. Place 9 into pool. Place 1 into pool. Place 2 into pool. Place 5 into pool. Place 8 into pool. Place 3 into pool.
To attach from spot (a whole number). The digit is item spot of pool. The symbol is the character for digit. Place symbol into candidate.
To gather from spot (a whole number). If spot is more than pickhi, return. The offset is spot minus picklo. The raised is shift 1 left by offset. The bit is bitwise and of pickmask and raised. If bit is more than 0, attach from spot. Gather from spot plus 1.
To judge from spot (a whole number). If bestsub comes before candidate, set improve to 1.
To pick from lo (a whole number) with hi (a whole number) and target (a whole number). Set bestsub to empty text. Set picklo to lo. Set pickhi to hi. Set started to 0. If target is 0, return.
For every mask from 0 to 63.
Set pickmask to mask. Set candidate to empty text. Gather from picklo. The lastp is the last position of candidate. The length is lastp plus 1.
If length is target.
Set improve to 0. If started is 0, set improve to 1. If started is 1, judge from 0. If improve is 1, Set bestsub to empty text, Place candidate into bestsub, set started to 1.
To leftstep from i (a whole number) with j (a whole number). The piece is the slice of lefttext from i to i plus 1. Place piece into mixed. Blend from i plus 1 with j. Remove last character from mixed.
To rightstep from i (a whole number) with j (a whole number). The piece is the slice of righttext from j to j plus 1. Place piece into mixed. Blend from i with j plus 1. Remove last character from mixed.
To score from spot (a whole number). If started is 0, Set bestmixed to empty text, Place mixed into bestmixed, set started to 1, return. If bestmixed comes before mixed, Set bestmixed to empty text, Place mixed into bestmixed.
To judgeover from spot (a whole number). If overall comes before bestmixed, set improve to 1.
To blend from i (a whole number) with j (a whole number). The leftlast is the last position of lefttext. The rightlast is the last position of righttext. If i is more than leftlast and j is more than rightlast, score from 0, return. If i is at most leftlast, leftstep from i with j. If j is at most rightlast, rightstep from i with j.
For every firstcount from 0 to 4.
The secondcount is 5 minus firstcount.
If secondcount is at most 6.
Set bestsub to empty text. Pick from 0 with 3 and firstcount. Set lefttext to empty text. Place bestsub into lefttext. Set bestsub to empty text. Pick from 4 with 9 and secondcount. Set righttext to empty text. Place bestsub into righttext. Set mixed to empty text. Set bestmixed to empty text. Set started to 0. Blend from 0 with 0. The oversize is the last position of overall. Set improve to 0. If oversize is -1, set improve to 1. If improve is 0, judgeover from 0. If improve is 1, Set overall to empty text, Place bestmixed into overall.
The line is empty text.
For every spot from 0 to 4.
If spot is more than 0, Place "," into line. The piece is the slice of overall from spot to spot plus 1. Place piece into line.
Show line.
Keep a shared coins holding 1, 2, and 5. Keep a shared dp as an empty list of whole numbers. The amount is 11.
For every spot from 0 to 11.
Place 12 into dp.
Set item 0 of dp to 0.
To relax from value (a whole number) with spot (a whole number). If spot is more than 2, return. The coin is item spot of coins.
If coin is at most value.
The candidate is item (value minus coin) of dp plus 1. If candidate is less than item value of dp, set item value of dp to candidate. Relax from value with spot plus 1.
For every value from 1 to amount.
Relax from value with 0.
Show item amount of dp.
The numbers is a list of 1, 5, 1, 1, 6, and 4. Sort numbers. The size is 6. The half is 3. The result is a list of 6 zeros.
For every spot from 0 to 2.
Set item (spot times 2) of result to item (half minus 1 minus spot) of numbers. Set item (spot times 2 plus 1) of result to item (size minus 1 minus spot) of numbers.
The line is empty text.
For every spot from 0 to 5.
If spot is more than 0, Place "," into line. The piece is format whole number item spot of result as text. Place piece into line.
Show line.
The number is 27. The value is number.
Repeat while value modulo 3 is 0.
Set value to value divided by 3.
If value is 1, show true, otherwise show false.
Keep a shared sums as an empty list of whole numbers. Keep a shared lower of 0. Keep a shared upper of 0. Keep a shared count of 0. The numbers is a list of -2, 5, and -1. Set lower to -2. Set upper to 2.
For every spot from 0 to 3.
Place 0 into sums.
For every spot from 1 to 3.
Set item spot of sums to item (spot minus 1) of sums plus item (spot minus 1) of numbers.
To scan from right (a whole number) with left (a whole number). If left is at least right, return. The difference is item right of sums minus item left of sums. If difference is at least lower and difference is at most upper, add 1 to count. Scan from right with left plus 1.
For every right from 1 to 3.
Scan from right with 0.
Show count.
The values is a list of 1, 2, 3, 4, and 5. The last is the last position of values. The odds is an empty list of whole numbers. The evens is an empty list of whole numbers.
For every spot from 0 to last.
If spot modulo 2 is 0, Place item spot of values into odds. If spot modulo 2 is 1, Place item spot of values into evens.
For each value in odds, show value. For each value in evens, show value.
The cells is a list of 9, 9, 4, 6, 6, 8, 2, 1, and 1. The order is an empty list of whole numbers.
For every spot from 0 to 8.
Place spot into order.
For every left from 0 to 8.
For every right from left to 8.
The lcell is item left of order. The rcell is item right of order. If item rcell of cells is less than item lcell of cells, swap item left of order and item right of order.
The depth is a list of 1, 1, 1, 1, 1, 1, 1, 1, and 1.
For every rank from 0 to 8.
The spot is 8 minus rank. The cell is item spot of order. The row is cell divided by 3. The column is cell modulo 3. The here is item cell of cells. The best is 1. The up is 0. The down is 0. The west is 0. The east is 0. If row is more than 0, set up to item (cell minus 3) of depth. If row is less than 2, set down to item (cell plus 3) of depth. If column is more than 0, set west to item (cell minus 1) of depth. If column is less than 2, set east to item (cell plus 1) of depth. If row is more than 0 and item (cell minus 3) of cells is more than here and up plus 1 is more than best, set best to up plus 1. If row is less than 2 and item (cell plus 3) of cells is more than here and down plus 1 is more than best, set best to down plus 1. If column is more than 0 and item (cell minus 1) of cells is more than here and west plus 1 is more than best, set best to west plus 1. If column is less than 2 and item (cell plus 1) of cells is more than here and east plus 1 is more than best, set best to east plus 1. Set item cell of depth to best.
The answer is 0.
For every spot from 0 to 8.
If item spot of depth is more than answer, set answer to item spot of depth.
Show answer.
The coins is a list of 1 and 3. The target is 6. The last is the last position of coins. The miss is 1. The spot is 0. The patches is 0.
Repeat while miss is at most target.
The took is 0. If spot is at most last and item spot of coins is at most miss, set miss to miss plus item spot of coins, add 1 to spot, set took to 1. If took is 0, add 1 to patches, set miss to miss plus miss.
Show patches.
The serial is "9,3,4,#,#,1,#,#,2,#,6,#,#". The tokens is split serial by ",". The slots is 1. The valid is 1.
For each token in tokens.
Subtract 1 from slots. If slots is less than 0, set valid to 0. If slots is less than 0, stop. If token does not match "#", add 2 to slots.
If valid is 1 and slots is 0, show true, otherwise show false.
Keep a shared starts as an empty list of text. Keep a shared finishes as an empty list of text. Keep a shared used holding 0, 0, 0, and 0. Keep a shared route as an empty list of text. Keep a shared winner as an empty list of text. Keep a shared found of 0. Place "MUC" into starts. Place "JFK" into starts. Place "SFO" into starts. Place "LHR" into starts. Place "LHR" into finishes. Place "MUC" into finishes. Place "SJC" into finishes. Place "SFO" into finishes.
To save from spot (a whole number). If spot is more than the last position of route, return. Place item spot of route into winner. Save from spot plus 1.
To seek from depth (a whole number). If found is 1, return. If depth is 4, set found to 1. If depth is 4, save from 0. If depth is 4, return.
For every spot from 0 to 3.
If found is 1, stop. The origin is item spot of starts. The arrival is item spot of finishes. The same is 1. If origin comes before item depth of route, set same to 0. If item depth of route comes before origin, set same to 0. The hit is 0. If item spot of used is 0 and same is 1, set hit to 1. If hit is 1, set item spot of used to 1. If hit is 1, Place arrival into route. If hit is 1, seek from depth plus 1. If hit is 1, remove the last item from route. If hit is 1, set item spot of used to 0.
Place "JFK" into route. Seek from 0. The answers is join winner with ",". The parts is split answers by ",". For each part in parts, show part.
The numbers is a list of 1, 2, 3, 4, and 5. The first is 1000000000. The second is 1000000000. The found is 0.
For each value in numbers.
If found is 1, stop. If value is at most first, set first to value. If value is more than first and value is at most second, set second to value. If value is more than second, set found to 1.
If found is 1, show true, otherwise show false.