The values is a list of 4, 2, 7, 1, and 3. The lefts is a list of 1, 3, -1, -1, and -1. The rights is a list of 2, 4, -1, -1, and -1. The wanted is 2. The node is 0.
Repeat while node is at least 0 and item node of values is not wanted.
If item node of values is more than wanted, set node to item node of lefts. If item node of values is less than wanted, set node to item node of rights.
The queue is an empty list of whole numbers. Place node into queue. The head is 0. The count is 1.
Repeat while head is less than count.
The current is item head of queue. Add 1 to head. Show item current of values. The left is item current of lefts. The right is item current of rights. If left is at least 0, Place left into queue, add 1 to count. If right is at least 0, Place right into queue, add 1 to count.
The key is 5. Keep a shared values holding 4, 2, 7, 1, 3, and key. Keep a shared lefts holding 1, 3, -1, -1, -1, and -1. Keep a shared rights holding 2, 4, -1, -1, -1, and -1. Keep a shared newspot of the last position of values.
To attach from node (a whole number) with key (a whole number). If key is less than item node of values, Step left from node with key, return. Step later from node with key.
To step left from node (a whole number) with key (a whole number). The left is item node of lefts. If left is less than 0, set item node of lefts to newspot, return. Attach from left with key.
To step later from node (a whole number) with key (a whole number). The later is item node of rights. If later is less than 0, set item node of rights to newspot, return. Attach from later with key.
Attach from 0 with key. 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. Show item node of values. 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. If right is at least 0, Place right into queue, add 1 to count.
The numbers is a list of -1, 0, 3, 5, 9, and 12. The target is 9. The low is 0. The high is the last position of numbers. The answer is -1.
Repeat while low is at most high and answer is -1.
The middle is the midpoint of low and high. If item middle of numbers is target, set answer to middle. If item middle of numbers is less than target, set low to middle plus 1. If item middle of numbers is more than target, set high to middle minus 1.
Show answer.
Keep a shared word as empty text. Place "Hello" into word. Keep a shared smalls as empty text. Place "abcdefghijklmnopqrstuvwxyz" into smalls. Keep a shared result as empty text. The last is the last position of word.
For every spot from 0 to last.
The symbol is the slice of word from spot to spot plus 1. The code is character 0 of symbol. The lowcap is character 0 of "A". The highcap is character 0 of "Z". The mapped is symbol. If code is at least lowcap and code is at most highcap, The offset is code minus lowcap, The lowerpiece is the slice of smalls from offset to offset plus 1, set mapped to lowerpiece. Place mapped into result.
Show result.
Keep a shared size of 5. Keep a shared blocked as an empty list of whole numbers. Place 1 into blocked. Keep a shared spare of 0. The lastblock is the last position of blocked. The blockedcount is lastblock plus 1. The allowed is size minus blockedcount. The mapping is a list of allowed zeros.
To seek from start (a whole number). If start is at least size, set spare to start, return. If blocked contains start, Seek from start plus 1, return. Set spare to start.
For every spot from 0 to lastblock.
The value is item spot of blocked. If value is less than allowed, Seek from allowed, Set item value of mapping to spare.
The seed is 2026.
For every pick from 0 to allowed minus 1.
Set seed to seed times 1103515245 plus 12345. Set seed to seed modulo 2147483648. The draw is seed modulo allowed. The chosen is item draw of mapping. If chosen is 0, set chosen to draw. Show chosen.
The first is "sea". The second is "eat". The firstsize is the number of characters in first. The secondsize is the number of characters in second. The width is secondsize plus 1. The size is (firstsize plus 1) times width. The table is a list of size zeros.
For every firstprefix from 1 to firstsize.
The cost is character (firstprefix minus 1) of first. Set item (firstprefix times width) of table to item ((firstprefix minus 1) times width) of table plus cost.
For every secondprefix from 1 to secondsize.
The cost is character (secondprefix minus 1) of second. Set item secondprefix of table to item (secondprefix minus 1) of table plus cost.
For every firstprefix from 1 to firstsize.
For every secondprefix from 1 to secondsize.
The index is firstprefix times width plus secondprefix. The leftcost is character (firstprefix minus 1) of first. The rightcost is character (secondprefix minus 1) of second. The removal is item (index minus width) of table plus leftcost. The insertion is item (index minus 1) of table plus rightcost. The best is the smaller of removal and insertion. If character (firstprefix minus 1) of first is character (secondprefix minus 1) of second, set item index of table to item (index minus width minus 1) of table. Otherwise, set item index of table to best.
The last is one less than size. Show item last of table.
The numbers is a list of 10, 5, 2, and 6. The limit is 100. The left is 0. The product is 1. The count is 0.
For every right from 0 to the last position of numbers.
Set product to product times item right of numbers. Repeat while left is at most right and product is at least limit, Set product to product divided by item left of numbers, Add 1 to left. Increase count by right minus left plus 1.
Show count.
The prices is a list of 1, 3, 2, 8, 4, and 9. The fee is 2. The cash is 0. The hold is 0 minus item 0 of prices.
For every spot from 1 to the last position of prices.
The price is item spot of prices. The sell is hold plus price minus fee. If sell is more than cash, set cash to sell. The buy is cash minus price. If buy is more than hold, set hold to buy.
Show cash.
The bits is a list of 1, 0, and 0. The last is the last position of bits. The spot is 0.
Repeat while spot is less than last.
If item spot of bits is 1, add 2 to spot, otherwise add 1 to spot.
If spot is last, show true, otherwise show false.
The first is a list of 1, 2, 3, 2, and 1. The second is a list of 3, 2, 1, 4, and 7. The rowsend is the last position of first. The columnsend is the last position of second. The rows is rowsend plus 1. The columns is columnsend plus 1. The width is columns plus 1. The size is (rows plus 1) times width. The table is a list of size zeros. The best is 0.
For every firstspot from 1 to rows.
For every secondspot from 1 to columns.
The index is firstspot times width plus secondspot. If item (firstspot minus 1) of first is item (secondspot minus 1) of second, set item index of table to item (index minus width minus 1) of table plus 1. If item index of table is more than best, set best to item index of table.
Show best.
Keep a shared numbers holding 1, 3, and 1. Keep a shared wanted of 1. Keep a shared finish of 0. Keep a shared bottom of 0. Keep a shared top of 0. Keep a shared answer of 0. Keep a shared tally of 0. Keep a shared front of 0. Sort numbers. Set finish to the last position of numbers. The endpoint is finish. Set top to item endpoint of numbers minus item 0 of numbers. Set answer to top.
To retreat from right (a whole number) with middle (a whole number). The spot is front. If item right of numbers minus item spot of numbers is at most middle, return. Add 1 to front. Retreat from right with middle.
To measure from middle (a whole number). Set tally to 0. Set front to 0.
For every right from 0 to finish.
Retreat from right with middle. Increase tally by right minus front.
Repeat while bottom is at most top.
The middle is the midpoint of bottom and top. Measure from middle. If tally is at least wanted, set answer to middle, set top to middle minus 1. If tally is less than wanted, set bottom to middle plus 1.
Show answer.
Keep a shared words holding "w", "wo", "wor", "worl", and "world". Keep a shared best as empty text. Keep a shared sought as empty text. Keep a shared valid of 0. Keep a shared found of 0.
To locate from spot (a whole number). If spot is more than the last position of words, return. If item spot of words matches sought, set found to 1, return. Locate from spot plus 1.
To check from index (a whole number). The word is item index of words. The last is the last position of word. Set valid to 1.
For every spot from 0 to last minus 1.
The prefix is the slice of word from 0 to spot plus 1. Set sought to prefix. Set found to 0. Locate from 0. If found is 0, set valid to 0.
For every index from 0 to the last position of words.
The word is item index of words. The last is the last position of word. Check from index.
If valid is 1.
The bestlast is the last position of best. If last is more than bestlast, set best to word. If last is bestlast, If word comes before best, set best to word.
Show best.
Keep a shared people holding "John", "John", "Mary", and "John". Keep a shared emails holding "johnsmith@mail.com", "john_newyork@mail.com", "johnsmith@mail.com", "john00@mail.com", "mary@mail.com", and "johnnybravo@mail.com". Keep a shared starts holding 0, 2, 4, 5, and 6. Keep a shared parents holding 0, 1, 2, and 3. Keep a shared rootresult of 0. Keep a shared sharedfound of 0. Keep a shared gathered as an empty list of text. Keep a shared merged as empty text. Keep a shared candidate as empty text. Keep a shared found of 0.
To root from node (a whole number). If item node of parents is node, set rootresult to node, return. Root from item node of parents.
To merge from first (a whole number) with second (a whole number). Root from first. The firstroot is rootresult. Root from second. The secondroot is rootresult. If firstroot is not secondroot, set item firstroot of parents to secondroot.
To share from first (a whole number) with second (a whole number). Set sharedfound to 0.
For every left from item first of starts to item (first plus 1) of starts minus 1.
For every right from item second of starts to item (second plus 1) of starts minus 1.
If item left of emails matches item right of emails, set sharedfound to 1.
To locate from spot (a whole number). If spot is more than the last position of gathered, return. If item spot of gathered matches candidate, set found to 1, return. Locate from spot plus 1.
To gather from person (a whole number) with root (a whole number). Root from person. If rootresult is not root, return.
For every spot from item person of starts to item (person plus 1) of starts minus 1.
Set candidate to item spot of emails. Set found to 0. Locate from 0. If found is 0, Place candidate into gathered.
To order. The total is the number of items in gathered. The final is total minus 1.
For every left from 0 to final.
For every right from left plus 1 to final.
If item right of gathered comes before item left of gathered, swap item left of gathered and item right of gathered.
To attach from spot (a whole number). If spot is more than the last position of gathered, return. Place "," into merged. Place item spot of gathered into merged. Attach from spot plus 1.
To wipe. The count is the number of items in gathered. If count is 0, return. Remove the last item from gathered. Wipe.
To render from person (a whole number) with root (a whole number). Wipe. For every member from 0 to the last position of people, Gather from member with root. Order. The source is item person of people. Set merged to a copy of source. Attach from 0. Show merged.
For every left from 0 to the last position of people.
For every right from left plus 1 to the last position of people.
Share from left with right. If sharedfound is 1, merge from left with right.
For every person from 0 to the last position of people.
Root from person. If rootresult is person, Render from person with person.
Keep a shared source holding "/*Test program */", "int main()", "{ ", " // variable declaration ", "int a, b, c;", "/* This is a test", " multiline ", " comment for ", " testing */", "a = b + c;", and "}". Keep a shared current as empty text. Keep a shared answers as an empty list of text. Keep a shared newline as empty text. Place "\n" into newline.
To flush. The size is the number of characters in current. If size is more than 0, Place current into answers. Set current to empty text.
The joined is join source with newline. The last is the last position of joined. The inblock is 0. The silent is 0. The spot is 0.
Repeat while spot is at most last.
The symbol is the slice of joined from spot to spot plus 1. The pair is symbol. If spot is less than last, set pair to the slice of joined from spot to spot plus 2. The opening is 0. The closing is 0. The notice is 0. The newlinehere is 0. If pair matches "/*", set opening to 1. If pair matches "*/", set closing to 1. If pair matches "//", set notice to 1. If symbol matches newline, set newlinehere to 1. The used is 1. If inblock is 1 and closing is 1, set inblock to 0, set used to 2. If inblock is 0 and newlinehere is 1, Flush, set silent to 0. If inblock is 0 and newlinehere is 0 and silent is 1, set used to 1. If inblock is 0 and newlinehere is 0 and silent is 0 and opening is 1, set inblock to 1, set used to 2. If inblock is 0 and newlinehere is 0 and silent is 0 and notice is 1, set silent to 1, set used to 2. If inblock is 0 and newlinehere is 0 and silent is 0 and opening is 0 and notice is 0 and used is 1, Place symbol into current. Increase spot by used.
Flush. For each answer in answers, show answer.
The numbers is a list of 1, 7, 3, 6, 5, and 6. The whole is 0.
For each value in numbers.
Add value to whole.
The left is 0. The answer is -1.
For every spot from 0 to the last position of numbers.
The rest is whole minus left minus item spot of numbers. If left is rest and answer is -1, set answer to spot. Increase left by item spot of numbers.
Show answer.
Keep a shared values holding 1, 2, and 3. Keep a shared width of 0. Keep a shared spot of 0. Keep a shared line as empty text. The parts is 5. The last is the last position of values. The size is last plus 1. The base is size divided by parts. The extra is size modulo parts.
To pack from start (a whole number) with count (a whole number). Place "[" into line.
For every step from start to start plus count minus 1.
If step is more than start, Place ", " into line. The piece is format whole number item step of values as text. Place piece into line.
For every part from 0 to parts minus 1.
Set width to base. If part is less than extra, add 1 to width. Set line to empty text. Pack from spot with width. Place "]" into line. Increase spot by width. Show line.
Keep a shared formula as empty text. Place "K4(ON(SO3)2)2" into formula. Keep a shared flatnames as an empty list of text. Keep a shared flatcounts as an empty list of whole numbers. Keep a shared flatvalid as an empty list of whole numbers. Keep a shared finalnames as an empty list of text. Keep a shared finalcounts as an empty list of whole numbers. Keep a shared scanspot of 0. Keep a shared limit of 0. Keep a shared parsename as empty text. Keep a shared parsecount of 0. Keep a shared mergename as empty text. Keep a shared foundspot of 0. Keep a shared multiplier of 0. Keep a shared parentstart of 0.
To findentry from spot (a whole number) with finish (a whole number). If spot is more than finish, return. The okay is item spot of flatvalid. The same is 0. If item spot of flatnames matches mergename, set same to 1. If okay is 1 and same is 1, set foundspot to spot, return. Findentry from spot plus 1 with finish.
To store with base (a whole number) and amount (a whole number). Set mergename to empty text. Place parsename into mergename. Set foundspot to -1. The finish is the last position of flatnames. Findentry from base with finish. The placefound is foundspot. If placefound is at least 0, set item placefound of flatcounts to item placefound of flatcounts plus amount. If placefound is at least 0, return. Place parsename into flatnames. Place amount into flatcounts. Place 1 into flatvalid.
To readlower. If scanspot is more than limit, return. The piece is the slice of formula from scanspot to scanspot plus 1. The spot is scanspot. The symbol is character spot of formula.
If symbol is between "a" and "z".
Place piece into parsename. Add 1 to scanspot. Readlower.
To readcount. If scanspot is more than limit, return. The piece is the slice of formula from scanspot to scanspot plus 1. The spot is scanspot. The symbol is character spot of formula.
If symbol is between "0" and "9".
The digit is the digit value of symbol. Set parsecount to parsecount times 10 plus digit. Add 1 to scanspot. Readcount.
To readelement from base (a whole number). Set parsename to empty text. The piece is the slice of formula from scanspot to scanspot plus 1. Place piece into parsename. Add 1 to scanspot. Readlower. Set parsecount to 0. Readcount. If parsecount is 0, set parsecount to 1. Store with base and parsecount. Readgroup from base.
To readmultiplier. If scanspot is more than limit, return. The piece is the slice of formula from scanspot to scanspot plus 1. The spot is scanspot. The symbol is character spot of formula.
If symbol is between "0" and "9".
The digit is the digit value of symbol. Set multiplier to multiplier times 10 plus digit. Add 1 to scanspot. Readmultiplier.
To skipclose. The piece is the slice of formula from scanspot to scanspot plus 1. If piece matches ")", add 1 to scanspot.
To multiplyrange from spot (a whole number) with finish (a whole number). If spot is more than finish, return. If item spot of flatvalid is 1, set item spot of flatcounts to item spot of flatcounts times multiplier. Multiplyrange from spot plus 1 with finish.
To mergeone from spot (a whole number). The name is item spot of flatnames. Set mergename to empty text. Place name into mergename. Set foundspot to -1. Findentry from parentstart with spot minus 1. The placefound is foundspot. If placefound is at least 0, set item placefound of flatcounts to item placefound of flatcounts plus item spot of flatcounts. If foundspot is less than 0, Place mergename into flatnames, Place item spot of flatcounts into flatcounts, Place 1 into flatvalid.
To mergerange from spot (a whole number) with finish (a whole number). If spot is more than finish, return. If item spot of flatvalid is 1, mergeone from spot. Mergerange from spot plus 1 with finish.
To readgroup from base (a whole number). If scanspot is more than limit, return. The piece is the slice of formula from scanspot to scanspot plus 1. If piece matches ")", return. If piece matches "(", readgroupbody from base, return. Readelement from base.
To readgroupbody from base (a whole number). Add 1 to scanspot. The top is the last position of flatnames. The childstart is top plus 1. Readgroup from childstart. Finishgroup with base and childstart.
To invalidate from spot (a whole number) with finish (a whole number). If spot is more than finish, return. Set item spot of flatvalid to 0. Invalidate from spot plus 1 with finish.
To finishgroup with base (a whole number) and childstart (a whole number). If scanspot is at most limit, skipclose. Set multiplier to 0. Readmultiplier. If multiplier is 0, set multiplier to 1. The childend is the last position of flatnames. Multiplyrange from childstart with childend. Set parentstart to base. Mergerange from childstart with childend. Invalidate from childstart with childend. Readgroup from base.
Set limit to the last position of formula. Readgroup from 0. The last is the last position of flatnames.
For every spot from 0 to last.
The okay is item spot of flatvalid.
If okay is 1.
The name is item spot of flatnames. The amount is item spot of flatcounts. Place name into finalnames. Place amount into finalcounts.
The finallast is the last position of finalnames.
For every left from 0 to finallast.
For every right from left plus 1 to finallast.
If item right of finalnames comes before item left of finalnames.
Swap item left of finalnames and item right of finalnames. Swap item left of finalcounts and item right of finalcounts.
The result is empty text.
For every spot from 0 to finallast.
The name is item spot of finalnames. The amount is item spot of finalcounts. Place name into result.
If amount is more than 1.
Place format whole number amount as text into result.
Show result.
The left is 1. The right is 22. Keep a shared quality of 1.
To check with value (a whole number) and original (a whole number). If value is 0, return. If quality is 0, return. The digit is value modulo 10. If digit is 0, set quality to 0, return. If original modulo digit is not 0, set quality to 0, return. Check with value divided by 10 and original.
The answers is an empty list of whole numbers.
For every number from left to right.
Set quality to 1. Check with number and number. If quality is 1, Place number into answers.
The line is empty text.
For each answer in answers.
If the length of line is more than 0, Place "," into line. Place format whole number answer as text into line.
Show line.
Keep a shared word as empty text. Place "bccb" into word. Keep a shared size of 4. Keep a shared modulus of 1000000007. Keep a shared table as an empty list of whole numbers.
For every spot from 0 to 15.
Place 0 into table.
Keep a shared firstspot of 0. Keep a shared lastspot of 0.
To findfirst from spot (a whole number) with finish (a whole number) and target (a whole number). If spot is at least finish, return. The here is character spot of word. If here is target, set firstspot to spot, return. Findfirst from spot plus 1 with finish and target.
To findlast from spot (a whole number) with finish (a whole number) and target (a whole number). If spot is less than finish, return. The here is character spot of word. If here is target, set lastspot to spot, return. Findlast from spot minus 1 with finish and target.
To fold from start (a whole number) with span (a whole number) and width (a whole number). The finish is start plus span minus 1. The next is start plus 1. The before is finish minus 1. The inside is item (next times width plus finish) of table. The below is item (start times width plus before) of table. The overlap is item (next times width plus before) of table. The value is inside plus below minus overlap. Set value to value modulo modulus. If value is less than 0, set value to value plus modulus. Set item (start times width plus finish) of table to value.
To match from start (a whole number) with span (a whole number) and width (a whole number). The finish is start plus span minus 1. If span is 2, set item (start times width plus finish) of table to 2, return. The next is start plus 1. The before is finish minus 1. The inside is item (next times width plus before) of table. The value is inside times 2. Set firstspot to -1. Set lastspot to -2. The target is character start of word. Findfirst from next with finish and target. Findlast from before with next and target. If firstspot is less than 0, set value to value plus 2. If firstspot is at least 0 and firstspot is lastspot, set value to value plus 1. The leftcut is firstspot plus 1. The rightcut is lastspot minus 1. If firstspot is at least 0 and firstspot is not lastspot, set value to value minus item (leftcut times width plus rightcut) of table. Set value to value modulo modulus. If value is less than 0, set value to value plus modulus. Set item (start times width plus finish) of table to value.
For every spot from 0 to 3.
Set item (spot times 4 plus spot) of table to 1.
For every span from 2 to 4.
For every start from 0 to 4 minus span.
The finish is start plus span minus 1. The firstchar is character start of word. The lastchar is character finish of word. If firstchar is not lastchar, Fold from start with span and size. If firstchar is lastchar, Match from start with span and size.
The last is size minus 1. Show item last of table.
Keep a shared image holding 1, 1, 1, 1, 1, 0, 1, 0, and 1. Keep a shared rows of 3. Keep a shared columns of 3. Keep a shared old of 0. The start is 4. Set old to item start of image. Keep a shared color of 2. Keep a shared queue as an empty list of whole numbers. Keep a shared count of 0. Keep a shared front of 0.
To expand from node (a whole number). The row is node divided by columns. The column is node modulo columns. The up is node minus columns. The down is node plus columns. The left is node minus 1. The right is node plus 1. If row is more than 0 and item up of image is old, set item up of image to color, Place up into queue, add 1 to count. If row is less than rows minus 1 and item down of image is old, set item down of image to color, Place down into queue, add 1 to count. If column is more than 0 and item left of image is old, set item left of image to color, Place left into queue, add 1 to count. If column is less than columns minus 1 and item right of image is old, set item right of image to color, Place right into queue, add 1 to count.
If old is not color.
Set item start of image to color. Place start into queue. Set count to 1.
Repeat while front is less than count.
The spot is front. The node is item spot of queue. Add 1 to front. Expand from node.
For each value in image, show value.
The rocks is a list of 5, 10, and -5. The last is the last position of rocks. The stack is an empty list of whole numbers.
For each rock in rocks.
If rock is more than 0, Place rock into stack.
If rock is less than 0.
The alive is 1.
Repeat while alive is 1.
The end is the last position of stack. If end is less than 0, Place rock into stack, set alive to 0, stop. The top is item end of stack. If top is less than 0, Place rock into stack, set alive to 0, stop. The size is 0 minus rock. If top is less than size, remove the last item from stack. If top is more than size, set alive to 0, stop. If top is size, remove the last item from stack, set alive to 0, stop.
The line is empty text.
For each rock in stack.
If the length of line is more than 0, Place "," into line. Place format whole number rock as text into line.
Show line.
Keep a shared tokens as an empty list of text. Keep a shared token as empty text. Keep a shared nextspot of 0. Keep a shared atom as empty text. Keep a shared wanted as empty text. Keep a shared parsevalue of 0. Keep a shared numbervalue of 0. Keep a shared lookupvalue of 0. Keep a shared depth of 0. Keep a shared groupclose of 0. Keep a shared names as an empty list of text. Keep a shared values as an empty list of whole numbers.
To flush. If the length of token is more than 0, Place token into tokens, set token to empty text.
To seekclose from spot (a whole number). If spot is more than the last position of tokens, return. The piece is item spot of tokens. If piece matches "(", add 1 to depth. If piece matches ")", subtract 1 from depth. If depth is 0, set groupclose to spot, return. Seekclose from spot plus 1.
To shrink from base (a whole number). If the last position of names is less than base, return. remove the last item from names. remove the last item from values. Shrink from base.
To lookup from spot (a whole number). If spot is less than 0, return. If item spot of names matches wanted, set lookupvalue to item spot of values, return. Lookup from spot minus 1.
To numbervalue from spot (a whole number). If spot is more than the last position of atom, return. The letter is character spot of atom. The digit is the digit value of letter. Set numbervalue to numbervalue times 10 plus digit. Numbervalue from spot plus 1.
To parsenumber. Set numbervalue to 0. Numbervalue from 0. Set parsevalue to numbervalue. Add 1 to nextspot.
To parse. The spot is nextspot. Set atom to item spot of tokens. If atom matches "(", parselist, return. If atom matches ")", return. The firstchar is character 0 of atom. If firstchar is between "0" and "9", parsenumber, return. Set wanted to atom. The top is the last position of names. Lookup from top. Set parsevalue to lookupvalue. Add 1 to nextspot.
To parselist. Add 1 to nextspot. The spot is nextspot. The operator is item spot of tokens. Add 1 to nextspot. If operator matches "add", parseadd, return. If operator matches "mult", parsemult, return. If operator matches "let", parselet, return.
To parseadd. Parse. The first is parsevalue. Parse. The second is parsevalue. Add 1 to nextspot. Set parsevalue to first plus second.
To parsemult. Parse. The first is parsevalue. Parse. The second is parsevalue. Add 1 to nextspot. Set parsevalue to first times second.
To parselet. Set depth to 0. The open is nextspot minus 2. Seekclose from open. The top is the last position of names. The base is top plus 1. The finish is groupclose. Letpairs with base and finish.
To finishlet with base (a whole number). Parse. Shrink from base.
To letpairs with base (a whole number) and finish (a whole number). The spot is nextspot. The atom is item spot of tokens. If atom matches "(", Finishlet with base, return. If nextspot plus 1 is finish, Finishlet with base, return. The name is atom. Add 1 to nextspot. Parse. Place name into names. Place parsevalue into values. Letpairs with base and finish.
The expression is "(let x 2 (mult x (let x 3 y 4 (add x y))))". The last is the last position of expression.
For every spot from 0 to last.
The symbol is the slice of expression from spot to spot plus 1. The special is 0. The brace is 0. If symbol matches "(", set brace to 1, set special to 1. If symbol matches ")", set brace to 1, set special to 1. If symbol matches " ", set special to 1. If special is 1, Flush. If special is 0, Place symbol into token. If brace is 1, Place symbol into tokens.
Flush. Set nextspot to 0. Parse. Show parsevalue.
The value is 332. The rest is value. The digits is an empty list of whole numbers.
Repeat while rest is more than 0.
Place rest modulo 10 into digits. Set rest to rest divided by 10.
The last is the last position of digits. Keep a shared ordered as an empty list of whole numbers.
For every spot from 0 to last.
The source is last minus spot. Place item source of digits into ordered.
Keep a shared cut of 0.
To repair from spot (a whole number). If spot is less than 0, return.
If item spot of ordered is more than item (spot plus 1) of ordered.
Decrease item spot of ordered by 1. Set cut to spot plus 1. Repair from spot minus 1.
Set cut to last plus 1. Repair from last minus 1. The result is 0.
For every spot from 0 to last.
The digit is item spot of ordered. If spot is at least cut, set digit to 9. Set result to result times 10 plus digit.
Show result.
The temperatures is a list of 73, 74, 75, 71, 69, 72, 76, and 73. The last is the last position of temperatures. The wait is a list of 8 zeros. The stack is an empty list of whole numbers.
For every day from 0 to last.
The settled is 0.
Repeat while settled is 0.
The end is the last position of stack. If end is less than 0, Place day into stack, set settled to 1, stop. The top is item end of stack. If item day of temperatures is more than item top of temperatures, remove the last item from stack, set item top of wait to day minus top. If item day of temperatures is at most item top of temperatures, Place day into stack, set settled to 1, stop.
The line is empty text.
For each value in wait.
If the length of line is more than 0, Place "," into line. Place format whole number value as text into line.
Show line.
The numbers is a list of 3, 4, 2. The last is the last position of numbers. The largest is 0.
For every spot from 0 to last.
If item spot of numbers is more than largest, set largest to item spot of numbers.
The counts is a list of largest plus 1 zeros.
For every spot from 0 to last.
The value is item spot of numbers. Increase item value of counts by 1.
The best is a list of largest plus 1 zeros.
For every value from 1 to largest.
The skip is 0. If value is more than 1, set skip to item (value minus 1) of best. The take is value times item value of counts. If value is more than 1, set take to take plus item (value minus 2) of best. If skip is more than take, set item value of best to skip, otherwise set item value of best to take.
Show item largest of best.
Keep a shared grid holding 0, 1, -1, 1, 0, -1, 1, 1, and 1. Keep a shared table as an empty list of whole numbers.
For every spot from 0 to 44.
Place -1 into table.
Keep a shared best of 0. Keep a shared stepnow of 0. Keep a shared firstnow of 0. Keep a shared secondnow of 0.
To improve from index (a whole number). If index is less than 0, return. If index is at least 45, return. The candidate is item index of table. If candidate is more than best, set best to candidate.
To walk. The firstcolumn is stepnow minus firstnow. The secondcolumn is stepnow minus secondnow. If firstcolumn is less than 0, return. If firstcolumn is at least 3, return. If secondcolumn is less than 0, return. If secondcolumn is at least 3, return. The firstcell is item (firstnow times 3 plus firstcolumn) of grid. The secondcell is item (secondnow times 3 plus secondcolumn) of grid. If firstcell is -1, return. If secondcell is -1, return. Set best to -1. The base is (stepnow minus 1) times 9. The above is firstnow minus 1. The beside is secondnow minus 1. The topstripe is above times 3. The firststripe is firstnow times 3. The secondstripe is secondnow times 3. The upleft is base plus topstripe plus beside. The upright is base plus firststripe plus beside. The downleft is base plus topstripe plus secondnow. The downright is base plus firststripe plus secondnow. Improve from upleft. Improve from upright. Improve from downleft. Improve from downright. If best is less than 0, return. The gain is firstcell. If firstnow is not secondnow, set gain to gain plus secondcell. The slot is stepnow times 9. The spot is slot plus firststripe plus secondnow. Set item spot of table to best plus gain.
If item 0 of grid is not -1, set item 0 of table to item 0 of grid.
For every step from 1 to 4.
For every firstrow from 0 to 2.
For every secondrow from 0 to 2.
Set stepnow to step. Set firstnow to firstrow. Set secondnow to secondrow. Walk.
The answer is item 44 of table. If answer is less than 0, show 0, otherwise show answer.
The nodes is 4. The large is 1000000. The times is a list of 2, 1, 1, 2, 3, 1, 3, 4, and 1. The graph is an empty list of whole numbers.
For every spot from 0 to 15.
Place large into graph.
For every spot from 0 to 3.
Set item (spot times 4 plus spot) of graph to 0.
For every pair from 0 to 2.
The base is pair times 3. The source is item base of times. The target is item (base plus 1) of times. The weight is item (base plus 2) of times. The slot is source minus 1. The place is target minus 1. The here is item (slot times 4 plus place) of graph. If weight is less than here, set item (slot times 4 plus place) of graph to weight.
For every middle from 0 to 3.
For every start from 0 to 3.
For every finish from 0 to 3.
The first is item (start times 4 plus middle) of graph. The second is item (middle times 4 plus finish) of graph. The through is first plus second. The direct is item (start times 4 plus finish) of graph. If through is less than direct, set item (start times 4 plus finish) of graph to through.
The answer is 0.
For every spot from 0 to 3.
The distance is item (4 plus spot) of graph. If distance is more than answer, set answer to distance.
If answer is at least large, show -1, otherwise show answer.
The letters is a list of "c", "f", and "j". The target is "a". The last is the last position of letters. The picked is 0.
For every spot from 0 to last.
If picked is 0.
If item spot of letters comes after target.
Show item spot of letters. Set picked to 1.
If picked is 0, Show item 0 of letters.
The costs is a list of 10, 15, and 20. The last is the last position of costs. The best is a list of last plus 2 zeros.
For every step from 2 to last plus 1.
The first is item (step minus 1) of best plus item (step minus 1) of costs. The second is item (step minus 2) of best plus item (step minus 2) of costs. If first is less than second, set item step of best to first, otherwise set item step of best to second.
Show item (last plus 1) of best.
The numbers is a list of 3, 6, 1, and 0. The last is the last position of numbers. The champion is 0. The bestspot is 0.
For every spot from 0 to last.
If item spot of numbers is more than champion, set champion to item spot of numbers, set bestspot to spot.
The second is -1.
For every spot from 0 to last.
If spot is not bestspot and item spot of numbers is more than second, set second to item spot of numbers.
The doubled is second times 2. If champion is at least doubled and bestspot is not -1, show bestspot, otherwise show -1.
The plate is "1s3 PSt". The alphabet is "abcdefghijklmnopqrstuvwxyz". The capitals is "ABCDEFGHIJKLMNOPQRSTUVWXYZ". The base is character 0 of alphabet. The upbase is character 0 of capitals. Keep a shared needed as an empty list of whole numbers.
For every letter from 0 to 25.
Place 0 into needed.
The platelast is the last position of plate.
For every spot from 0 to platelast.
The symbol is character spot of plate. The lower is 0. If symbol is at least base and symbol is at most base plus 25, set lower to symbol. If symbol is at least upbase and symbol is at most upbase plus 25, set lower to symbol plus base minus upbase.
If lower is more than 0.
The index is lower minus base. Increase item index of needed by 1.
The words is a list of "step", "steps", "stripe", and "stepp". The wordlast is the last position of words. The slots is wordlast plus 1. The size is slots times 26. Keep a shared lettercounts as an empty list of whole numbers.
For every spot from 0 to size minus 1.
Place 0 into lettercounts.
For every slot from 0 to wordlast.
The word is item slot of words. The letters is the last position of word.
For every spot from 0 to letters.
The symbol is character spot of word. The index is symbol minus base. Increase item (slot times 26 plus index) of lettercounts by 1.
Keep a shared good of 0.
To inspect with slot (a whole number). Set good to 1.
For every letter from 0 to 25.
The have is item (slot times 26 plus letter) of lettercounts. If have is less than item letter of needed, set good to 0.
The best is -1. The bestsize is 0.
For every slot from 0 to wordlast.
Inspect with slot. The word is item slot of words. The end is the last position of word. The sizeword is end plus 1. If good is 1 and best is -1, set best to slot, set bestsize to sizeword. If good is 1 and best is not -1 and sizeword is less than bestsize, set best to slot, set bestsize to sizeword.
Show item best of words.
Keep a shared grid holding 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, and 0. Keep a shared seen as an empty list of whole numbers.
For every spot from 0 to 31.
Place 0 into seen.
Keep a shared regioncells as an empty list of whole numbers. Keep a shared regionstart as an empty list of whole numbers. Keep a shared regionwalls as an empty list of whole numbers. Keep a shared threats as an empty list of whole numbers. Keep a shared regionthreatstart as an empty list of whole numbers. Keep a shared currentregion of 0. Keep a shared regioncount of 0. Keep a shared wantedcell of 0. Keep a shared threatfound of 0. Keep a shared rangestart of 0. Keep a shared rangefinish of 0. Keep a shared threatbegin of 0. Keep a shared threatend of 0. Keep a shared bestregion of 0. Keep a shared bestscore of 0. Keep a shared totalwalls of 0. Keep a shared active of 0.
To resetseen from spot (a whole number). If spot is more than 31, return. Set item spot of seen to 0. Resetseen from spot plus 1.
To clearcells. If the last position of regioncells is less than 0, return. remove the last item from regioncells. Clearcells.
To clearstarts. If the last position of regionstart is less than 0, return. remove the last item from regionstart. Clearstarts.
To clearwalls. If the last position of regionwalls is less than 0, return. remove the last item from regionwalls. Clearwalls.
To clearthreats. If the last position of threats is less than 0, return. remove the last item from threats. Clearthreats.
To clearthreatstarts. If the last position of regionthreatstart is less than 0, return. remove the last item from regionthreatstart. Clearthreatstarts.
To findthreat from spot (a whole number) with finish (a whole number). If spot is more than finish, return. If item spot of threats is wantedcell, set threatfound to 1, return. Findthreat from spot plus 1 with finish.
To exploreempty from cell (a whole number). The region is currentregion. Increase item region of regionwalls by 1. Set wantedcell to cell. The start is item region of regionthreatstart. The finish is the last position of threats. Set threatfound to 0. Findthreat from start with finish. If threatfound is 0, Place cell into threats.
To explore from cell (a whole number). If cell is less than 0, return. If cell is more than 31, return. If item cell of seen is 1, return. If item cell of grid is 2, return. If item cell of grid is 0, exploreempty from cell, return. Set item cell of seen to 1. Place cell into regioncells. The row is cell divided by 8. The column is cell modulo 8. If row is more than 0, explore from cell minus 8. If row is less than 3, explore from cell plus 8. If column is more than 0, explore from cell minus 1. If column is less than 7, explore from cell plus 1.
To scanone from spot (a whole number). The cellend is the last position of regioncells. The cellstart is cellend plus 1. The threatend is the last position of threats. The threatstart is threatend plus 1. Place cellstart into regionstart. Place threatstart into regionthreatstart. Place 0 into regionwalls. Set currentregion to the last position of regionwalls. Explore from spot.
To scan from spot (a whole number). If spot is more than 31, return. If item spot of grid is 1 and item spot of seen is 0, scanone from spot. Scan from spot plus 1.
To choose. Set bestregion to -1. Set bestscore to -1. The lastregion is the last position of regionwalls.
For every region from 0 to lastregion.
The score is item region of regionwalls. If score is more than bestscore, set bestscore to score, set bestregion to region.
To bounds with region (a whole number). Set rangestart to item region of regionstart. Set rangefinish to the last position of regioncells.
If region is less than regioncount minus 1.
The next is region plus 1. The nextstart is item next of regionstart. Set rangefinish to nextstart minus 1.
To threatbounds with region (a whole number). Set threatbegin to item region of regionthreatstart. Set threatend to the last position of threats.
If region is less than regioncount minus 1.
The next is region plus 1. The nextstart is item next of regionthreatstart. Set threatend to nextstart minus 1.
To quarantine from spot (a whole number) with finish (a whole number). If spot is more than finish, return. The cell is item spot of regioncells. Set item cell of grid to 2. Quarantine from spot plus 1 with finish.
To spreadcells from spot (a whole number) with finish (a whole number). If spot is more than finish, return. The cell is item spot of threats. Set item cell of grid to 1. Spreadcells from spot plus 1 with finish.
To spread from region (a whole number). If region is more than the last position of regionwalls, return. If region is bestregion, spread from region plus 1, return. Threatbounds with region. Spreadcells from threatbegin with threatend. Spread from region plus 1.
To apply. The chosen is bestregion. The score is item chosen of regionwalls. Increase totalwalls by score. Bounds with chosen. Quarantine from rangestart with rangefinish. Spread from 0.
To reset. Resetseen from 0. Clearcells. Clearstarts. Clearwalls. Clearthreats. Clearthreatstarts. Set bestregion to -1.
Set active to 1.
Repeat while active is 1.
Reset. Scan from 0. The top is the last position of regionwalls. Set regioncount to top plus 1. Choose. If bestregion is less than 0, set active to 0. If bestregion is at least 0, Apply.
Show totalwalls.
Keep a shared blocked as an empty list of whole numbers. Keep a shared distance as an empty list of whole numbers. Keep a shared seen as an empty list of whole numbers. Keep a shared weights as an empty list of whole numbers. Keep a shared digittext as empty text. Keep a shared decoded of 0. Keep a shared queue as an empty list of whole numbers. Keep a shared count of 0. For every cell from 0 to 9999, Place 0 into blocked. For every cell from 0 to 9999, Place 0 into distance. For every cell from 0 to 9999, Place 0 into seen. For every cell from 0 to 9999, Place 0 into queue. Place 1 into weights. Place 10 into weights. Place 100 into weights. Place 1000 into weights.
To extract from spot (a whole number). If spot is more than 3, return. The symbol is the slice of digittext from spot to spot plus 1. The digit is the digit value of character spot of digittext. Set decoded to decoded times 10 plus digit. Extract from spot plus 1.
To spread from here (a whole number).
For every slot from 0 to 3.
The weight is item slot of weights. The digit is (here divided by weight) modulo 10. The higher is digit plus 1. If higher is 10, set higher to 0. The lower is digit minus 1. If lower is less than 0, set lower to 9. The upstate is here plus (higher minus digit) times weight. The downstate is here plus (lower minus digit) times weight. If item upstate of blocked is 0 and item upstate of seen is 0, set item upstate of seen to 1, set item upstate of distance to item here of distance plus 1, Set item count of queue to upstate, add 1 to count. If item downstate of blocked is 0 and item downstate of seen is 0, set item downstate of seen to 1, set item downstate of distance to item here of distance plus 1, Set item count of queue to downstate, add 1 to count.
Keep a shared deadends holding "0201", "0101", "0102", "1212", and "2002".
For each note in deadends.
Set digittext to note. Set decoded to 0. Extract from 0. The state is decoded. Set item state of blocked to 1.
Set digittext to empty text. Place "0202" into digittext. Set decoded to 0. Extract from 0. The goal is decoded. Set item 0 of queue to 0. Set item 0 of seen to 1. The head is 0. Set count to 1. The answer is -1. If item goal of blocked is 1, set answer to -1.
If item goal of blocked is 0 and item 0 of blocked is 0.
Repeat while head is less than count and answer is less than 0.
The here is item head of queue. Add 1 to head. If here is goal, set answer to item here of distance. If here is not goal, spread from here.
Show answer.
Keep a shared seen as an empty list of whole numbers. Keep a shared base of 0. Keep a shared span of 0. Keep a shared digits as empty text. Keep a shared result as empty text. Set base to 2. Set span to 1. Place "0123456789" into digits. For every slot from 0 to 9999, Place 0 into seen.
To explore from node (a whole number).
For every digit from 0 to base minus 1.
The edge is node times base plus digit.
If item edge of seen is 0.
Set item edge of seen to 1. The nextnode is edge modulo span. Explore from nextnode. The piece is the slice of digits from digit to digit plus 1. Place piece into result.
Explore from 0. Show result.
The target is 3. The distance is the absolute value of target. The total is 0. The steps is 0.
Repeat while total is less than distance.
Add 1 to steps. Add steps to total.
Repeat while (total minus distance) modulo 2 is not 0.
Add 1 to steps. Add steps to total.
Show steps.
Keep a shared current as empty text. Keep a shared nextrow as empty text. Keep a shared patterns as an empty list of text. Keep a shared patternlast of 0. Keep a shared solved of 0. Place "BCD" into current. Place "BCG" into patterns. Place "CDE" into patterns. Place "GEA" into patterns. The patternend is the last position of patterns. Set patternlast to patternend.
To search. If solved is 1, return. The width is the last position of current. If width is 0, set solved to 1, return. Set nextrow to empty text. Grow from 0.
To trynext. The width is the last position of current. The extent is the number of characters in nextrow. If extent is not width, return. The parent is a copy of current. The built is a copy of nextrow. Set current to a copy of built. Search. Set current to a copy of parent. Set nextrow to a copy of built.
To grow from spot (a whole number). If solved is 1, return. The width is the last position of current. The limit is width minus 1. If spot is more than limit, trynext, return. Attempt from spot with 0.
To attempt from spot (a whole number) with which (a whole number). If solved is 1, return. If which is more than patternlast, return. The pattern is item which of patterns. The left is the slice of current from spot to spot plus 1. The right is the slice of current from spot plus 1 to spot plus 2. The first is the slice of pattern from 0 to 1. The second is the slice of pattern from 1 to 2. The top is the slice of pattern from 2 to 3. If first does not match left, Attempt from spot with which plus 1, return. If second does not match right, Attempt from spot with which plus 1, return. Place top into nextrow. Grow from spot plus 1. remove last character from nextrow. Attempt from spot with which plus 1.
Search. If solved is 1, show true, otherwise show false.
The starts is a list of 1, 3, and 8. The ends is a list of 3, 7, and 9. The last is the last position of starts.
For every left from 0 to last.
For every right from left plus 1 to last.
If item right of ends is less than item left of ends, swap item left of ends and item right of ends, swap item left of starts and item right of starts. If item right of ends is item left of ends and item right of starts is more than item left of starts, swap item left of ends and item right of ends, swap item left of starts and item right of starts.
The chosenlow is -1000000000. The chosenhigh is -1000000000. The total is 0.
For every interval from 0 to last.
The low is item interval of starts. The high is item interval of ends. If chosenlow is less than low and chosenhigh is at least low, set chosenlow to chosenhigh, set chosenhigh to high, add 1 to total. If chosenhigh is less than low, set chosenlow to high minus 1, set chosenhigh to high, add 2 to total.
Show total.
Keep a shared source as empty text. Keep a shared rendered as empty text. Keep a shared closer of 0. Keep a shared capacity of 0. Keep a shared level of 0. Keep a shared used as an empty list of whole numbers. Keep a shared collection as an empty list of text. Place "11011000" into source. Set capacity to 32. For every slot from 0 to 31, Place 0 into used.
For every slot from 0 to 511.
Place "" into collection.
To locate from start (a whole number) with finish (a whole number). The depth is 0. The probe is start. Set closer to finish.
Repeat while probe is at most finish.
The symbol is the slice of source from probe to probe plus 1. If symbol matches "1", add 1 to depth. If symbol matches "0", set depth to depth minus 1. If depth is 0, set closer to probe, return. Add 1 to probe.
To arrange with base (a whole number) with count (a whole number). The lastindex is base plus count minus 1.
For every left from base to lastindex.
For every right from left plus 1 to lastindex, if item left of collection comes before item right of collection, swap item left of collection and item right of collection.
To finishframe. The base is level times capacity. The spot is level. The count is item spot of used. Arrange with base with count. The built is empty text. Place "1" into built. For every slot from base to base plus count minus 1, Place item slot of collection into built. Place "0" into built. Set rendered to built.
To shape from cursor (a whole number) with limit (a whole number). If cursor is more than limit, finishframe, return. Locate from cursor with limit. The childend is closer. Set item (level plus 1) of used to 0. Increase level by 1. Shape from cursor plus 1 with childend minus 1. Decrease level by 1. The child is a copy of rendered. The base is level times capacity. The spot is level. The slot is base plus item spot of used. Set item slot of collection to child. Increase item spot of used by 1. Shape from childend plus 1 with limit.
The end is the last position of source. Set item 0 of used to 0. Shape from 1 with end minus 1. Show rendered.
Keep a shared current of 0. Keep a shared bits of 0.
To tally.
Repeat while current is more than 0.
The low is bitwise and of current and 1. Add low to bits. Set current to shift current right by 1.
The left is 6. The right is 10. The primes is a list of 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, and 0. The total is 0.
For every value from left to right.
Set current to value. Set bits to 0. Tally. The count is bits. If item count of primes is 1, add 1 to total.
Show total.
Keep a shared word as empty text. Place "ababcbacadefegdehijhklij" into word. Keep a shared last of 0. Keep a shared finish of 0. Keep a shared cursor of 0.
To extend.
Repeat while cursor is at most finish.
The symbol is the slice of word from cursor to cursor plus 1. The far is cursor. For every probe from cursor to last, if the slice of word from probe to probe plus 1 matches symbol, set far to probe. If far is more than finish, set finish to far. Add 1 to cursor.
The end is the last position of word. Set last to end. The answers is an empty list of whole numbers. The begin is 0.
Repeat while begin is at most last.
Set finish to begin. Set cursor to begin. Extend. The width is finish minus begin plus 1. Place width into answers. Set begin to finish plus 1.
For each width in answers, show width.
Keep a shared size of 0. Keep a shared cells as an empty list of whole numbers. Keep a shared best of 0. Set size to 5. For every spot from 0 to 24, Place 1 into cells. Set item 22 of cells to 0.
To test with center (a whole number). The band is center divided by size. The column is center modulo size. If item center of cells is 0, return. The arm is 0. The open is 1.
Repeat while open is 1.
The reach is arm plus 1. If band is less than reach or band plus reach is at least size or column is less than reach or column plus reach is at least size, set open to 0.
If band is at least reach and band plus reach is less than size and column is at least reach and column plus reach is less than size.
The above is item ((band minus reach) times size plus column) of cells. The below is item ((band plus reach) times size plus column) of cells. The leftcell is item (band times size plus column minus reach) of cells. The rightcell is item (band times size plus column plus reach) of cells. If above is 1 and below is 1 and leftcell is 1 and rightcell is 1, set arm to reach. If arm is more than best, set best to arm. If above is not 1 or below is not 1 or leftcell is not 1 or rightcell is not 1, set open to 0.
For every center from 0 to 24.
Test with center.
The answer is best plus 1. Show answer.
Keep a shared seats holding 0, 2, 1, and 3. Keep a shared last of 0. The end is the last position of seats. Set last to end. Keep a shared swaps of 0.
To pairseat with seat (a whole number). The first is item seat of seats. The mate is first plus 1. If first modulo 2 is 1, set mate to first minus 1. The second is item (seat plus 1) of seats. If second is mate, return. The found is seat plus 1. For every probe from seat plus 2 to last, if item probe of seats is mate, set found to probe. swap item (seat plus 1) of seats and item found of seats. Add 1 to swaps.
For every seat from 0 to last by 2.
Pairseat with seat.
Show swaps.
The cells is a list of 1, 2, 3, 4, 5, 1, 2, 3, 9, 5, 1, and 2. The good is 1.
For every band from 0 to 1.
For every column from 0 to 2.
The here is item (band times 4 plus column) of cells. The below is item ((band plus 1) times 4 plus column plus 1) of cells. If here is not below, set good to 0.
If good is 1, show true, otherwise show false.
The source is "aab". The last is the last position of source. The letters is an empty list of text. The counts is an empty list of whole numbers.
For every spot from 0 to last.
The symbol is the slice of source from spot to spot plus 1. The found is -1. For every which from 0 to the last position of letters, if item which of letters matches symbol, set found to which. If found is less than 0, Place symbol into letters, Place 1 into counts. If found is at least 0, set item found of counts to item found of counts plus 1.
The result is empty text. The earlier is empty text. The built is 0. The impossible is 0.
Repeat while built is less than last plus 1 and impossible is 0.
The pick is -1. The best is -1.
For every which from 0 to the last position of letters.
The amount is item which of counts. The letter is item which of letters. If amount is less than 1, skip to the next one. If letter matches earlier, skip to the next one. If amount is at most best, skip to the next one. Set pick to which. Set best to amount. If pick is less than 0, set impossible to 1. If pick is at least 0, Place item pick of letters into result, set item pick of counts to item pick of counts minus 1, set earlier to item pick of letters, add 1 to built.
If impossible is 1, Show "". If impossible is 0, Show result.
The numbers is a list of 2, 1, 3, 4, and 4. The last is the last position of numbers. The prefixes is a list of 5 zeros. The suffixes is a list of 5 zeros. Set item 0 of prefixes to item 0 of numbers.
For every spot from 1 to last.
Set item spot of prefixes to item (spot minus 1) of prefixes. If item spot of numbers is more than item spot of prefixes, set item spot of prefixes to item spot of numbers.
Set item last of suffixes to item last of numbers.
For every spot from last minus 1 to 0 by -1.
Set item spot of suffixes to item (spot plus 1) of suffixes. If item spot of numbers is less than item spot of suffixes, set item spot of suffixes to item spot of numbers.
The chunks is 1. For every split from 0 to last minus 1, if item split of prefixes is at most item (split plus 1) of suffixes, add 1 to chunks. Show chunks.
The numbers is a list of 1, 0, 2, 3, and 4. The last is the last position of numbers. The chunks is 0. The high is 0.
For every spot from 0 to last.
If item spot of numbers is more than high, set high to item spot of numbers. If high is spot, add 1 to chunks.
Show chunks.
Keep a shared token as empty text. Keep a shared parsed of 0. The expression is "e + 8 - a + 5". The tokens is split expression by " ". The constant is 0. The lettercoef is 0. The sign is 1. The last is the last position of tokens.
To read 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 token. Set parsed to parsed times 10 plus digit. Read from spot plus 1 with finish.
For every spot from 0 to last.
Set token to item spot of tokens. The symbol is character 0 of token. If symbol is "+", set sign to 1. If symbol is "-", set sign to -1. Set parsed to 0. The finish is the last position of token. If symbol is between "0" and "9", read from 0 with finish. If symbol is between "0" and "9", set constant to constant plus sign times parsed. If symbol is "e", set constant to constant plus sign. If symbol is "a", set lettercoef to lettercoef plus sign.
If lettercoef is not 0.
The lead is format whole number lettercoef as text. Place "*a" into lead. Show lead.
Show format whole number constant as text.
The gems is "aA". The stones is "aAAbbbb". The lastgem is the last position of gems. The laststone is the last position of stones. The total is 0.
For every spot from 0 to laststone.
The piece is the slice of stones from spot to spot plus 1.
For every probe from 0 to lastgem.
The jewelpiece is the slice of gems from probe to probe plus 1. If jewelpiece matches piece, add 1 to total.
Show total.
Keep a shared board holding 1, 2, 3, 4, 0, and 5. Keep a shared weights holding 117649, 16807, 2401, 343, 49, and 7. Keep a shared queue as an empty list of whole numbers. Keep a shared reached as an empty list of whole numbers. Keep a shared distances as an empty list of whole numbers. Keep a shared head of 0. Keep a shared count of 0. Keep a shared known of 0. Keep a shared blank of 0. For every slot from 0 to 4095, Place 0 into queue.
To locate from candidate (a whole number). Set known to -1. For every which from 0 to the last position of reached, if item which of reached is candidate, set known to which, return.
To findblank from here (a whole number). Set blank to 0.
For every spot from 0 to 5.
The piece is (here divided by item spot of weights) modulo 7. If piece is 1, set blank to spot.
To spread from here (a whole number). Findblank from here. The empty is blank. The blankband is empty divided by 3. The blankcolumn is empty modulo 3.
For every other from 0 to 5.
The otherband is other divided by 3. The othercolumn is other modulo 3. The bandgap is the absolute value of (otherband minus blankband). The columngap is the absolute value of (othercolumn minus blankcolumn).
If bandgap plus columngap is 1.
The moving is (here divided by item other of weights) modulo 7. The next is here plus (moving minus 1) times item empty of weights plus (1 minus moving) times item other of weights. Locate from next. If known is less than 0, The tail is count, The depth is head, Set item tail of queue to next, Place next into reached, Place (item depth of distances plus 1) into distances, add 1 to count.
The start is 0. For every spot from 0 to 5, set start to start plus (item spot of board plus 1) times item spot of weights. The goal is 0. For every spot from 0 to 4, set goal to goal plus (spot plus 2) times item spot of weights. Increase goal by item 5 of weights. Set item 0 of queue to start. Place start into reached. Place 0 into distances. Set count to 1. The answer is -1.
Repeat while head is less than count.
The front is head. The here is item front of queue. If here is goal, The progress is head, set answer to item progress of distances, stop. Spread from here. Add 1 to head.
Show answer.
The numbers is a list of 1, 0, and 2. The last is the last position of numbers. The overall is 0. The nearby is 0.
For every first from 0 to last.
For every second from first plus 1 to last, if item first of numbers is more than item second of numbers, add 1 to overall.
For every spot from 0 to last minus 1, if item spot of numbers is more than item (spot plus 1) of numbers, add 1 to nearby.
If overall is nearby, show true, otherwise show false.