[Question]
  [
## Challenge
Mark is a student who receives his `N` marks in a concatenated way in a one single line.
The challenge is to separate his marks, knowing that each mark can only be `0` or `1` or `2` or `3` or `4` or `5` or `6` or `7` or `8` or `9` or `10`.
## Input
`N` natural number and one line.
## Output
A set of natural numbers.
## Example
```
N, One line------------------> Set of marks
3, '843'---------------------> [8, 4, 3]
1, '0'-----------------------> [0]
2, '1010'--------------------> [10,10]
3, '1010'--------------------> [1,0,10] or [10,1,0] 
4, '1010'--------------------> [1,0,1,0]
9, '23104441070'-------------> [2, 3, 10, 4, 4, 4, 10, 7, 0]
12,'499102102121103'---------> [4, 9, 9, 10, 2, 10, 2, 1, 2, 1, 10, 3]
5, '71061'-------------------> [7, 1, 0, 6, 1]
11,'476565010684'------------> [4, 7, 6, 5, 6, 5, 0, 10, 6, 8, 4]
4, '1306'--------------------> [1, 3, 0, 6]
9, '51026221084'-------------> [5, 10, 2, 6, 2, 2, 10, 8, 4]
14,'851089085685524'---------> [8, 5, 10, 8, 9, 0, 8, 5, 6, 8, 5, 5, 2, 4]
11,'110840867780'------------> [1, 10, 8, 4, 0, 8, 6, 7, 7, 8, 0]
9, '4359893510'--------------> [4, 3, 5, 9, 8, 9, 3, 5, 10]
7, '99153710'----------------> [9, 9, 1, 5, 3, 7, 10]
14,'886171092313495'---------> [8, 8, 6, 1, 7, 10, 9, 2, 3, 1, 3, 4, 9, 5]
2, '44'----------------------> [4, 4]
4, '9386'--------------------> [9, 3, 8, 6]
```
## Rules
* When several outputs are possible give only one output.
* Only mark of value `10` is on two decimal, others are on one decimal.
* The input and output can be given [in any convenient format](http://meta.codegolf.stackexchange.com/q/2447/42963)
* No need to handle invalid input
* Either a full program or a function are acceptable. If a function, you can return the output rather than printing it.
* If possible, please include a link to an online testing environment so other people can try out your code!
* [Standard loopholes](http://meta.codegolf.stackexchange.com/q/1061/42963) are forbidden.
* This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'") so all usual golfing rules apply, and the shortest code (in bytes) wins.
  
[Answer]
# [Brachylog](https://github.com/JCumin/Brachylog), ~~23~~ 21 bytes
*-2 bytes thanks to Fatalize*
```
h~c.{ịℕ≤10&ịṫ?∧}ᵛ&t~l
```
[Try it online!](https://tio.run/##SypKTM6ozMlPN/r/P6MuWa/64e7uRy1TH3UuMTRQA7If7lxt/6hjee3DrbPVSupy/v@PVjI0NDQwNFDSMY39HwEA "Brachylog – Try It Online")
The input is a pair `[Line, N]`.
This is my first Brachylog program, so there is probably a lot room for improvement.
It is very slow when the length of the line > 7.
Explanation:
```
h~c.{ịℕ≤10&ịṫ?∧}ᵛ&t~l
h                         The first element in the input
 ~c                       is formed by concatenating
   .                      the elements in the output array
   .{         ∧}ᵛ     AND For every element in the output array holds that
     ị                      The element converted to an integer
      ℕ                       is a natural number
       ≤10                    and less than or equal to 10
          &ịṫ?              and it has no leading zeroes (*)
                 &t   AND The second element of the input
                   ~l     is the length of the output 
```
(\*) `ịṫ?` checks that there are no leading zeroes. It converts the string to integer and then back to string and compares to the original string.
[Answer]
# [Perl 6](https://github.com/nxadm/rakudo-pkg), 25 bytes
```
->\a,\b{b~~/(10|.)**{a}/}
```
[Try it online!](https://tio.run/##jVNdTyMxDHzfX5EHdGkh0HjjfIGOP3LdhyIoQoK7U/uESvnrZeLs9k7LVlBFqSPN2DO29@/D5jkcXl7Vj7X6qQ6Xt8uVWd7t7t7fFzOyb1fz8/Pdar/YH26a9Z@Nmj0//X7YztWuUerl@nGxvL9Y3CDerl7VenZmzRnNm/3BGaUTO3059btVv5JRbJTrGgLQTsMEaLumBYQsTaMAIWsIMPcVzAhOwYRQDOKGv0MCsskAto4sM5ONIzyAEAkByFt81VMe0SiQqTWacybbltMS2f86AzLAWU6htP/@hru80SsPDZFsID0tNgoY2IAAVQlVY/DBw2BIrEdwFnnA@uG2tRQeZT5d7Y6z4XR3iunCqA3ysBdamBwVK1h/tBXk7m3WQsRGJ7BTtsmH5H3LerQu/ojPUjINumvgJSNX11QU2BRiTFZ/1jzUHfIEaUSUuB81O59Tdv7TZtS@OSmYBzmul9c1SKIxaO/ixE6B249Z8E5qFpbYT4FAylgyx9mP7VeZ1FMkS79yctcN8vVjYdYnvyc@Dja7dHKw1VOp2X0A "Perl 6 – Try It Online")
Anonymous code block that takes a number and a string and returns as a Match object.
### Explanation:
```
->\a,\b{                }  # Anonymous code block taking params a and b
        b~~/           /   # Match using b
            (10|.)           # 10 or a single digit
                  **{a}      # Exactly a times, being greedy
```
[Answer]
# [Python 3](https://docs.python.org/3/), 47 bytes
```
lambda s,n:[*s.replace(b'\1\0',b'\n',len(s)-n)]
```
[Try it online!](https://tio.run/##fczBCoMwDAbg@54it7ajjma6TQWfZN3BusoEF6UtQ5@@E9HbGIH8OXx/xjm8BkpjW@nY12/zrMFLKu9Hf3J27OvGcsM0asXkksRkb4l7kZB4xGagj3UBKtibJZg5WM@nJMvbwcEEHYEXh9F1FPjml4eolsF1r5diYkftfyYx@0nz/Io3VMU5xTQrLhuMXw "Python 3 – Try It Online")
Takes the "one line" as a bytestring with raw bytes `\x00 - \x09`. If it's not acceptable:
# [Python 3](https://docs.python.org/3/), 56 bytes
```
lambda s,n:[x-48for x in s.replace(b'10',b':',len(s)-n)]
```
[Try it online!](https://tio.run/##K6gsycjPM/6fZhvzPycxNyklUaFYJ88qukLXxCItv0ihQiEzT6FYryi1ICcxOVUjSd3QQF0nSd1KXScnNU@jWFM3TzP2f0FRZl6JRhpYFggNwSSYBVRsaKKpyYVQYWFhZmhuaGBpZGxobGJpCpH/DwA "Python 3 – Try It Online")
Takes "one line" as bytestring.
[Answer]
# [V](https://github.com/DJMcMayhem/V), ~~17~~, 12 bytes
```
\ÓòÀGjí1“î…0
```
[Try it online!](https://tio.run/##ASoA1f92//9cw5PDssOAR2rDrTHCk8OuwoUw//8xNTEwODkwODU2ODU1MjT/MTQ "V – Try It Online")
I was content with 17 bytes, but than 05AB1E came along with 13, and I couldn't let a challenge go unanswered. :D
```
\Ó                      " Put each character on it's own line
  ò                     " Recursively (repeat until an error happens)...
   ÀG                   "   Go to the "n"th line
     j                  "   Move down a line (this will error if there are exactly "n" lines)
      í                 "   Remove...
       1                "     a '1'
        <0x93>          "     START THE MATCH HERE
              î         "     a newline
               <0x85>   "     END THE MATCH HERE
                   0    "     a '0'
```
Hexdump:
```
00000000: 5cd3 f2c0 476a ed31 93ee 8530            \...Gj.1...0
```
Alternate solution:
```
\ÓòÀGjç1î0/J
```
Unfortunately, this replaces `10` with `1 0`
[Answer]
# [Ruby](https://www.ruby-lang.org/), 57 bytes
```
->n,m{m.sub!"10",?A while m[n];m.chars.map{|c|c.to_i 16}}
```
[Try it online!](https://tio.run/##jVNda8JAEHzvr7jah7yc4Tb3Tamlv0NCUakoNCpaKUX97ene3qWxJtqG43IHM7uzk8l2P/2q50/1cLTi1aHKd/vp/QDEgD@/sM/F8v2NVeNV@Vjls8Vku8uryeZwnB1n@cf6dcnAnE71hs3HkrPMKZmVD8O@Z8TGjjPFmSzvAhwQLq6BCS4isEAgCLiGRSAIDgks/wZzQrP1NhI5nomq/kflqZNHeCFBKKVA2A4L4Sgc5WCPMHVc4WI5SyWg4JnyHkQRVgEgfrmHJZDiaQVi0b6aPdyTnxr1WBAG@vVjMUsUZBg8JAWACqzRRuPgxqkLblRgiaGbXcS2eAnfs2y9k8Lc8i6YEXitfRrHNgUO32kcGPpnXEN7Gr9tCopnDms4L5w2TutCXdjnSHBieWrvmkniQVNd1boBQY1wxlonum5Aq6GpZsggS@ezaCipvfNS9@QpuiqpuW@kySQ1VsByGQZDS9ubR6yQYkEsSf0bLtniDCDVY0Cl8rprSxQOiUi1Ulxpj7nT7Q@o1NVfNY5zFgQv3Y0gxFlD/7L@Bg "Ruby – Try It Online")
This may turn out to be not the golfiest approach, but it looks like a fun idea to temporarily substitute `10` for a hex `A`, which incidentally is also a high mark (if we consider A-F grading system :))
[Answer]
# [Haskell](https://www.haskell.org/), 68 bytes
```
n!('1':'0':x)|n-2<length x=10:(n-1)!x
n!(s:x)=read[s]:(n-1)!x
n!_=[]
```
[Try it online!](https://tio.run/##y0gszk7Nyfn/P09RQ91Q3UrdQN2qQrMmT9fIJic1L70kQ6HC1tDASiNP11BTsYILqKoYKG9blJqYEl0ciyQebxsd@z83MTNPwVahoCgzr0RBRcFEUcnQwNBA6T8A "Haskell – Try It Online")
Greedily take 10s as long as there are more digits than marks remaining.
[Answer]
# JavaScript, ~~57~~ 52 bytes
```
n=>g=s=>s[n]?g(s.replace(x=10,`x`)):[...s].map(eval)
```
[Try It Online](https://tio.run/##dZHdasMwDIXv9yQObEayJf8M3D1IKSRkadjIklCP0rfPZHY1ZoOv9B1JR8efw33I4@1j/35Zt/fpuKZjTac55XTK5/XyNqusb9O@DOOkHgnhuX/0Xfd61lrni/4adjXdh6U7xm3N2zLpZZvVVdlO9YGsKJ/@AhQA/8tGyghYIbZJqEmiEGMRiAjBVwRY9lGMCKY8gwgVrywij@CwMqDcQd6xY3HgAjXsWXB1eyx7nZHttVYsvUEkIUJgF5gNNTxgmQDBeR8aQZDlGKLlWlBeuKTA1tfor43gUGiUPC1Frn8dNe6PNpT7jx8)
[Answer]
# [Python 3](https://docs.python.org/3/), ~~71 68~~ 59 bytes
down another 9 bytes thanks to ovs.
```
lambda n,s:[int(c,11)for c in s.replace('10','a',len(s)-n)]
```
[Try it online!](https://tio.run/##bZDLasQwDEX3/YrsnIBbJEvyozBf0naRpgkdyHhCMpv5@lQpFOpkwKsjXx9fTffb9zXTOpze17G9fH61VbbL69s53@rOIjbDda666pyr5WXup7Ht@togGGtaY8c@10vznJuPdZq3xFCTrUxkMk3z9IdQEfwHTgECFoweMH7AkjJHCMyMEIoROms4JQS3HYcIxTdEkwHBY5FBzQQvXtTjIx/0BH6vF33eO5WU15GtiTqLCaL4KOJ4b8ItA9GHEA@lmCTFRFLWDTrRSkKh5L@y6FFx0nUQJ9lvmA9lEsWtzPoD "Python 3 – Try It Online")
I was iniitially trying to use `str.partition()` recursively, but using `replace` smacked me in the face not too long after. Can anyone improve on this?
[Also, here's a TIO link that I used to make the test cases into something more copy/pasteable](https://tio.run/##jZNLTsMwEIbX5BRWNm4kt/LE4xcSXASyYNGKSrRUkAUIcfby205KlaaCynLs@pv3zOGzf37dm2O//ujv6ro2SsjARi7nfvfiISjBSpiuIoB6Hsug7qoWCGmap4CQVgTM/IWpzInXtyKicK74P0IgqwiwNaSZmbSf8ADhJByA3hRXWenilYAwtUpyjKTbtFoifZYZCAOOeSWR9vcz7umOXFn44Ek7kvPO@gyDdTjAKsGqd9ZZBOgCywnO2T2wdtx1MYVLqk9XsmO0u56dFHSSKAmyCM@1CHJiLLH2FJbL@xBmMUSsZIB0iDpYF6xtWU7axZ74mE2G0e9ysFkjl6gpeaCD8z5oeenzaHfU43IifD4PpWZjY4jGXnRGyZvJBuPojhnc6yookSi0NX6mpyA7lDnzJttMUjn84AhCEU1mONpp@MVNGkSylqHl8l46yJZhYZZX54lPhY0mXC1siSnZ7DDMx/fDi7gTD9t@vVvhvO0XcikbzKbYYJrS32K7F2n2x@fHvWy64/krHm6rm8Pbdt8v6vLZLL6@m6ZeAds99YtENs3xBw "Python 3 – Try It Online")
[Answer]
# [Haskell](https://www.haskell.org/), 98 bytes
```
n!x=[y|y<-s x,y==take n y]!!0
s('1':'0':x)=do y<-s x;[1:0:y,10:y]
s(x:y)=(read[x]:)<$>s y
s _=[[]]
```
[Try it online](https://tio.run/##JcpBCoMwEADAu6/YiBADFhLoaev2I0soAQMVbVqMhyz49yj0Mqd5h7zEda01qUIsh4y3DGUQoj0sERKIV8o2uddOo7Yai6HpC//2YIcWZXAX/joFxVC/xTBx8WjG7plBmgwvYva@fsKcgOC3zWmHDu6qddbZtp4 "Haskell – Try It Online") or [test all!](https://tio.run/##dZNNb5wwEIbv/IrBqrQgGcnGH9g03nsPPfVIUUSUVRslIdHCAdT2t28HY@@STbKyDF49r2femeF3Nzwenp5OWZrX9bd@LPY/xuND/6vYN3hqT306uWb@O98UA0x0dm7sHg/Qw9ymKUuGbMd39Y7t6il39y@wYl8bXrN6phy3FpmpnnOXHQ/dfTO1dX7zZT/AnAxw65qmbU/P3UMPDp671@@3kP3MOnqXF3t4xTRGyDrn7vIcxsMwDkniH@ASgAYykRIjBYE3PwqNoSC9GQqizZPlv4ynhF2RnmURKFPCGb9iEOAMfURIfAz9KRpOPQcvx@LfKqJ4CjL52d105QJmU1IKzqSUnFWRRqxEHxTwTpBxLYeKwlnKMX1pLWflskrOGdYFpYhavxZBeXnEfTmfa6RSUnGmOblKs/IokhpfzhGxorLSSit0po0kAZY@MSRV3NkaBg9LY9pNTQTTH9RkMbvwm7IodKVL9BbieFKd7Wi/B3vbIByjGBQby4zSRqlSkjAh6kxbH87EjNcX5e@TW7d8Cc@MrirDyCXbGDPeon0BKv@@ba0Uyhor1GUO1moJH8zGVERILSqrlGBflai284PK0FZPCx/vovG2jeaosThRQloVba8J8iDwd4Tx8vs6L2rzUUhJ3n818m0jrTDvG7l6MbGR7ek/ "Haskell – Try It Online")
## Explanation
The function `s` does all possible splits, for example: `"1010"` becomes `[[1,0,1,0],[10,1,0],[1,0,10],[10,10]]`, note how the longest splits end up at the beginning (because `1:0:y` comes before `10:y`).
With that in mind, we can take all these values and filter the `y`s out where `y == take n y` which keeps also splits that are shorter than required. For example with `4` we leave the list the same `[[1,0,1,0],[10,1,0],[1,0,10],[10,10]]`.
Now we can just get the first element in that list because the inputs will always be valid (eg. `5!"1010"` would give `[1,0,1,0]` too, but we don't need to handle it).
**Note:** I somehow miscounted.. `y==take n y` is the same length as `length y==n` :S
[Answer]
# [R](https://www.r-project.org/), 63 bytes
While the length of the string is larger than `n`, substitute the next 10 you reach for a `":"` (the ASCII character after 9). Then split into numbers by taking the ASCII value of each char in the string.
```
function(n,x){while(nchar(x)>n)x=sub(10,":",x);utf8ToInt(x)-48}
```
[Try it online!](https://tio.run/##ZVLLagMxDLz3K5b0sBtwwLIlP/rIvffeSg5t6JJA2UCa0EDpt29l@RFKwXgteaSZWfk4jw@reTxP29P@MA2Tuiy/v3b7j/dh2u5ej8NluZ6Wl8fP89sAWi3uFgy4P5/G8Hx4mk58vcLwM4@DVV0f0PbL23X3ElSHqrObm3EAzuuc1Sk2HIOGkuKWIGn7N60k3x2OGaL4zCD8D1JSHfnCWNCICNqXe2birlyetOSVAq86qQGjeowRtEnLAOginnFRVkKb66fuKRZrxKwetINc5@WWLx0fhAGYwTtyxJpdwNbeC4bqrnNPDtJ/21SjVrtqNBlJiOqVWLIzLLw2pSbTyV5k136Aqg9cFKIO5AKRwTYoatAoJKEqyweSZlj9QOLUwXkf2hgaVa13YtHLuc0HLcUQLdXxobgioc3ktohJFVzc83DI@oovMxGMle4ZKd6CAwZGfgMWIzVvWQsUtDQor0L2PGmqzxKvE2pTiDa4xm9zx838Cw "R – Try It Online")
[Answer]
# [Perl 5](https://www.perl.org/) `-plF`, 39 bytes
```
$a=<>;$_="@F";s/1 0/10/ while$a-1<y/ //
```
[Try it online!](https://tio.run/##K0gtyjH9/18l0dbGzlol3lbJwU3JuljfUMFA39BAX6E8IzMnVSVR19CmUl9BX///f0MDQwMuk3/5BSWZ@XnF/3V9TfWAIv91C3LcAA "Perl 5 – Try It Online")
[Answer]
# [Clean](https://github.com/Ourous/curated-clean-linux), 128 bytes
```
import StdEnv
@[]=[[]]
@['10':t]=[u++v\\u<-[[10],[1,0]],v<- @t];@[h:t]=[[digitToInt h:v]\\v<- @t]
?n l=hd[e\\e<- @l|length e==n]
```
[Try it online!](https://tio.run/##LY2xCoMwFEV3vyJbBxWUbtagQzsI3ez28oZgUhNIYqkxUOi3N42l2z2XA2cykrtoF7EZSSzXLmr7WJ6ejF5cXMh6QAqAmMahrg6NT7jleWBsa0uAusIC6qJCLEJbkt7jqQf1s0DoWfvbMjhPVBOQsb@RdY4YqgRIxuR@mbeRbvaKSEodxtHz1KekI8e9maoYP9Pd8HmN5XCN55fjVk/rFw "Clean – Try It Online")
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 13 bytes
```
.œsù.ΔïTÝÃJ¹Q
```
[Try it online!](https://tio.run/##ATAAz/9vc2FiaWX//y7Fk3PDuS7OlMOvVMOdw4NKwrlR//84NTEwODkwODU2ODU1MjQKMTQ "05AB1E – Try It Online")
or as a [Test Suite](https://tio.run/##JY49TgQxDEZ7n2I09bKy45/YDXQUdEiAZkuQKKgott6KI0DLGbamjmi50vCNNopkJ3kvn9@Pzy9vr6vk7ePTYVn3v5/H8bP/@xrnh/E9Pu6W@/U0zvN0dT3Ny7yb5sMN1m5NU1JiEhIWpnYpeilGTYXNTLgzFVmVcNt2E2FAjbpwCDlZDw@HFGkk@E054DvgaFBwW5Q4ZnF6pHsDt6F44ozekzfP1CtLAYJHnCsSqFNmCLrCQGrlm2oYj0oTOf8)
**Explanation**
```
.œ              # partitions of the first input
  sù            # of a length equal to the second input
    .Δ          # find the first partition that returns true when:
      ï         # each element is converted to integer
       TÝÃ      # and only numbers in [0 ... 10] are kept
          J     # then join it together
           ¹Q   # and compare it to the first input for equality
```
[Answer]
# [JavaScript (Babel Node)](https://babeljs.io/), ~~70 69~~ 59 bytes
Takes input as `(n)(line)`.
```
n=>s=>(a=s.match(/10|./g)).flatMap(x=>x>9&&!a[--n]?[1,0]:x)
```
[Try it online!](https://tio.run/##hZPdbuIwEIXv9ym8N00iBfDE47@VQp@gT4BykVJgW7GkKmjFxb47Hf@ElNrtRpZjS/7GZ05OXvq//XH99vx6mj32j5v97DA8bS7b9nJol8d2Wfbtcf6nP61/lwvg/@aLXVXNt/v@9NC/lud2eV7au7uf/Wo2O3T3K6h59@tcXdbD4TjsN/P9sCu3JRNVWRgUBfvwVBVbLNjK1AxrJrofnxAghN8AV4Qnhxs6DBxuzsfDwGtIAfENUHuCDW8Bpo7YZxz/g9fpjZaQRgBHROA6kBFpqP@a0V3OiTDcRtcsKQOuU7QWeONGA8BFEcsQZv1wcDO9xtntU58lFdTAFRRJK9pjRClaJErcB0KtpJJkhDJYTCB68UTJcebhetq4791l/RRcZf105jg2a6kkG1RDZgQBIyWv7Ss/Rztyl4O73FAdY7mRykjZYDGFU15J62WYsauwkL42Zt0Bp4obpbXhxU1Ho5axovKGab/ORweFtMYKOWZuclp4EXaUKKLkpIqmKhQcKfSU21glxsaTwutI@WCTUUC4pSALtPKDTaEJiLCvF2Pt55BNmf1xEYvcX45fBcUKkwtK6N3p6C7v "JavaScript (Babel Node) – Try It Online")
### Commented
```
n => s =>                       // given n and s
  (a = s.match(/10|./g))        // split s into marks; a '1' followed by a '0' is always
                                // interpreted as '10'
  .flatMap(x =>                 // for each mark x:
    x > 9 &&                    //   if x = '10',
    !a[--n] ?                   //   then decrement n; if a[n] is undefined:
      [1, 0]                    //     yield [1, 0]
    :                           //   else:
      x                         //     yield the mark unchanged
  )                             // end of flatMap()
```
---
# JavaScript (ES6), ~~64~~ 59 bytes
*Saved 5 bytes thanks to @guest271314*
Takes input as `(n)(line)`.
```
n=>g=([...s])=>1/s[n]?g(eval(`[${s}]`.replace('1,0',10))):s
```
[Try it online!](https://tio.run/##hZPditswEIXv@xS6KMgG1dFYo7@FbB8kGDak3rAlxEu87E3ps6ejH8ebldoaIUugb3Tm@Pjn/n0/Hy4vr2/fztOP8fq8vZ63j8dts@u6bh7a7SNs5t15@H5sxvf9qXnaff01/x6eusv4etofxoaDkFyAbNv2Yb4epvM8ncbuNB2b54aptuEOFWcfnrZlmw3bOcFQMDV8@YQAIfIOuCGyONzTYZBwdz4fBkmiCkD9AxCRYNMlwYLWn3H8Dy7KGz0hvQKJiCBtIjPSU/@C0V3BiTTCxgpWlIHQKXoPsg@jB5CK5zKE@TgC3K@vZQ770mdNBS1IA7xoxUaMKEOLQkn4QGiNNpqMMA75CmIUT5ReZpmup0343kPVTyVN1c9gTmCrlmqywfRkRhKwUPrWvolztqN2OYTLHdVxXjptnNY98jWc@kb6KMMtXaWFjrWx6g4EVdIZa53kdx0tWpaKJhpm47oeHVTaO6/0krnVaRVF@EWiypKLKpaqUHC0smtuc5Ucm0iqqKPkk03OAOGegqzQ6w82pSYgw7FejnWcUzZ19cdF5LW/HP8WFK9cLSip96BjuP4B "JavaScript (Node.js) – Try It Online")
### Commented
```
n =>                            // main function, taking n
  g = ([...s]) =>               // g = recursive function, taking s
                                //     (which is either a string or an array)
    1 / s[n] ?                  // if s[n] is defined (i.e. we have too many marks):
      g(                        //   do a recursive call to g:
        eval(                   //     build a new array by evaluating ...
          `[${s}]`              //       ... the string representation of s[] where the
          .replace('1,0', 10)   //       first occurrence of '1,0' is replaced with '10'
        )                       //     end of eval()
      )                         //   end of recursive call
    :                           // else:
      s                         //   return s
```
[Answer]
# [Java (OpenJDK 8)](http://openjdk.java.net/), 78 bytes
A nice one-liner using the streams API.
```
(n,l)->l.join(":",l.split("10",l.length()-n+1)).chars().map(i->i-48).toArray()
```
[Try it online!](https://tio.run/##jZTBbpwwEIbPy1NYPtlaQDa2wYQ2VR@gufS43YO7IRtvWYPAiRRF@@zbMaA2UlOIhTQYf/z@Z8xwMs8mabvane5/Xbunn409oENjhgF9M9ah1yhCMOaFwRsPwTpf9w/mUKM7ANA8ZgYWd3vkCETkYvTd99YdUUOrEbxEmzHOSnfIoc/oSlzc0OS2SU@tdQTf4LhJh66xnmDOwqSp3dE/Epq4Lac0PTyafiA0PZuO2OTWJlLT1Ldf@968EHqt3jP93Np7dIacyGQJTJr@ONC3GcBzP4m41BERI6ylwHT2/g7CAWFLQAYAZ3yRER9g5AeYEphMcCal5KxYRHnwJcuSsyxcGedsMU8FeMFZzhdFQzVkkatcgdNcy9WEBMvXElLgL8/A5bIcD3oaYF0yrXKtVCZXvfKgynReFHq1sFKoUpdCLR9BASRUVYlimZvs6pwDV8KZCVmqtc9IrtazFPpvPS//bYI3b07NasI9fY02D20/9q2FpmQVsp/Glbn7YL7dBirIzm3d9TWggAP/BeEdRjcIx7iaoZfB1@e0ffLpuCcJ@Hbabmf3tELRBn4I/2B4/8PhP2lcrr8B "Java (OpenJDK 8) – Try It Online")
---
**How it works**
```
(n,l)->                     // Lambda function taking int and string
  l.join(":",               // Join the following array with colons
    l.split("10",           // Split the original string on "10"...
      l.length()-n+1))      // But limit the parts to the difference between the length
                            // and expected length, to only remove  required number of 10s              
  .chars()                  // Convert to an intstream of codepoints
  .map(i->i-48)             // Remove 48 to get the numeric value of each codepoint
  .toArray()                // Return an int array
```
[Answer]
# [Red](http://www.red-lang.org), 91 bytes
```
func[n s][while[n < length? s][replace s"10""a"]foreach c s[prin[either c =#"a"[10][c]""]]]
```
[Try it online!](https://tio.run/##XZBBbsQgDEX3cwrLvQAGA6Zq1TvMFrGIMqSJFGVGSao5fkoWVWEkFvjZ@v/ba74d13yL6TK8H8PP0scFthSf4zTn8v2AOS/f@/h1wjU/5q7PsCEpxA7TcF9z14/QwxYf67TEPO1jXkv9@Vb6kVSKfUJMKR1nf4cBDKCwwctfTYDqv9JQtKkC5hXwKwiA2pBiZlK@4qSRQyClz6eJVGVqAT0pR9U0IXtnnS3aTrj1M8o1frZIOl2E60FilNKQoMQ6sVZzo07ntBLnvbTh2dggwdh6Jw9Yolvja3gaiKPCQlnYcLDN3bgNHYw4PH4B "Red – Try It Online")
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 18 bytes
```
Ḍ⁵⁻ƊƝr1ŒpS‘⁼ɗƇḢk⁸Ḍ
```
[Try it online!](https://tio.run/##VdE9SgRBEIbhq3gAg6rq7unZcxiKoYluIGZmTiSIkYkmJnsHYUBTBzzGzkVaeZtPRvh4oqmpn7663O/vWjvOT@v0vk4fy@Pydutfzzdn6/3rOn1@vywPx/lwvU7z7zettfPd6UnPiBUHLJgxYaCjqWRUKg5YMGPCQEdTo6rCngELZkwY6Ggab1C7XthTMGPCQEfTUkVDVpUUJWPCQEfTKbJWq2qUVdiTMNDRdMCkg1SNl9SuF/YEOprOHjpj1VKhIbNKQnE0PZbr@FWncK2W1chV2GPk76Ftc3zbHMQ2Q9r/wlFPU7Rd/79dtLDdDw "Jelly – Try It Online")
[Answer]
# [Stax](https://github.com/tomtheisen/stax), 11 [bytes](https://github.com/tomtheisen/stax/blob/master/docs/packed.md#packed-stax)
```
ô 0┤'ï╒Äì√¡
```
[Run and debug it](https://staxlang.xyz/#p=932030b4278bd58e8dfbad&i=+%22843%22,3%0A+%220%22,1%0A+%221010%22,2%0A+%221010%22,3%0A+%221010%22,4%0A+%2223104441070%22,9%0A%22499102102121103%22,12%0A+%2271061%22,5%0A%22476565010684%22,11%0A+%221306%22,4%0A+%2251026221084%22,9%0A%22851089085685524%22,14%0A%22110840867780%22,11%0A+%224359893510%22,9%0A+%2299153710%22,7%0A%22886171092313495%22,14%0A+%2244%22,2%0A+%229386%22,4&a=1&m=2)
It was very interesting to find a way to outgolf the V answer.
## Explanation
```
|!{11rJj-!}jJ
|!            all array partitions of length n
  {       }j  first element which satisfies:
   11r        range 0-10
      J       joined with spaces
       j      split on spaces
        -     set difference with the current iteration
         !    negated
              is true?
            J join with spaces
```
]