Cody

# Problem 43658. When Was That Goal Scored?

Solution 1993254

Submitted on 28 Oct 2019
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Fail
ged = '<goal><value><elapsed>47</elapsed><subtype>header</subtype></value></goal>'; elapsed = getElapsedTime(ged); elapsed_correct = [47]; assert(isequal(elapsed,elapsed_correct))

elapsed = 1×1 cell array {'elapsed>47</'}

Assertion failed.

2   Fail
ged = '<goal><value><comment>n</comment><stats><goals>1</goals><shoton>1</shoton></stats><event_incident_typefk>406</event_incident_typefk><elapsed>22</elapsed><player2>38807</player2><subtype>header</subtype><player1>37799</player1><sortorder>5</sortorder><team>10261</team><id>378998</id><n>295</n><type>goal</type><goal_type>n</goal_type></value><value><comment>n</comment><stats><goals>1</goals><shoton>1</shoton></stats><event_incident_typefk>393</event_incident_typefk><elapsed>24</elapsed><player2>24154</player2><subtype>shot</subtype><player1>24148</player1><sortorder>4</sortorder><team>10260</team><id>379019</id><n>298</n><type>goal</type><goal_type>n</goal_type></value></goal>'; elapsed = getElapsedTime(ged); elapsed_correct = [22;24]; assert(isequal(elapsed,elapsed_correct))

elapsed = 1×2 cell array {'elapsed>22</'} {'elapsed>24</'}

Assertion failed.

3   Fail
ged = '<goal><value><comment>n</comment><stats><goals>1</goals><shoton>1</shoton></stats><event_incident_typefk>406</event_incident_typefk><elapsed>73</elapsed><player2>25668</player2><subtype>header</subtype><player1>38755</player1><sortorder>2</sortorder><team>10194</team><id>465096</id><n>321</n><type>goal</type><goal_type>n</goal_type></value></goal>'; elapsed = getElapsedTime(ged); elapsed_correct = [73]; assert(isequal(elapsed,elapsed_correct))

elapsed = 1×1 cell array {'elapsed>73</'}

Assertion failed.

4   Fail
ged = '<goal><value><comment>n</comment><stats><goals>1</goals><shoton>1</shoton></stats><event_incident_typefk>393</event_incident_typefk><elapsed>3</elapsed><player2>24635</player2><subtype>shot</subtype><player1>37139</player1><sortorder>3</sortorder><team>8650</team><id>468555</id><n>239</n><type>goal</type><goal_type>n</goal_type></value><value><comment>o</comment><stats><owngoals>1</owngoals></stats><event_incident_typefk>115</event_incident_typefk><elapsed>69</elapsed><player1>30617</player1><sortorder>3</sortorder><team>8650</team><id>468934</id><n>304</n><type>goal</type><goal_type>o</goal_type></value><value><comment>n</comment><stats><goals>1</goals><shoton>1</shoton></stats><elapsed_plus>1</elapsed_plus><event_incident_typefk>393</event_incident_typefk><elapsed>90</elapsed><player2>23949</player2><subtype>shot</subtype><player1>40755</player1><sortorder>2</sortorder><team>8586</team><id>469035</id><n>328</n><type>goal</type><goal_type>n</goal_type></value></goal>'; elapsed = getElapsedTime(ged); elapsed_correct = [3; 69; 90]; assert(isequal(elapsed,elapsed_correct))

elapsed = 1×3 cell array {'elapsed>3</'} {'elapsed>69</'} {'elapsed>90</'}

Assertion failed.

5   Fail
ged = '<goal><value><comment>n</comment><stats><goals>1</goals><shoton>1</shoton></stats><elapsed>11</elapsed><subtype>shot</subtype><team>8472</team><id>507018</id><n>250</n><type>goal</type><goal_type>n</goal_type></value><value><comment>n</comment><stats><goals>1</goals><shoton>1</shoton></stats><elapsed>18</elapsed><subtype>header</subtype><team>8559</team><id>507106</id><n>255</n><type>goal</type><goal_type>n</goal_type></value><value><comment>n</comment><stats><goals>1</goals><shoton>1</shoton></stats><elapsed>21</elapsed><subtype>shot</subtype><team>8559</team><id>507142</id><n>259</n><type>goal</type><goal_type>n</goal_type></value><value><comment>dg</comment><elapsed>30</elapsed><subtype>shot</subtype><team>8472</team><id>507259</id><n>148</n><type>goal</type><goal_type>dg</goal_type></value><value><comment>n</comment><stats><goals>1</goals><shoton>1</shoton></stats><elapsed>39</elapsed><subtype>shot</subtype><team>8559</team><id>507390</id><n>278</n><type>goal</type><goal_type>n</goal_type></value><value><comment>n</comment><stats><goals>1</goals><shoton>1</shoton></stats><elapsed>55</elapsed><subtype>shot</subtype><team>8559</team><id>507734</id><n>295</n><type>goal</type><goal_type>n</goal_type></value></goal>'; elapsed = getElapsedTime(ged); elapsed_correct = [11; 18; 21; 30; 39; 55]; assert(isequal(elapsed,elapsed_correct))

elapsed = 1×6 cell array {'elapsed>11</'} {'elapsed>18</'} {'elapsed>21</'} {'elapsed>30</'} {'elapsed>39</'} {'elapsed>55</'}

Assertion failed.