text:
Rotated Position of Integers
Challenge:
Input:
A sorted list of positive integers.
Output:
The amount of integers which are still at the exact same index, after rotating the digits in each integer its index amount of times towards the left and sorting the modified list again.
Example:
Input: [8,49,73,102,259,762,2782,3383,9217,37846,89487,7471788]
Output (0-based indexing): 6
Output (1-based indexing): 5
Why?
0-based indexing:
After rotating each: [8,94,73,102,592,276,8227,3338,9217,63784,89487,7887471]
Sorted again:        [8,73,94,102,276,592,3338,8227,9217,63784,89487,7887471]

Input indices:        0  1  2   3   4   5    6    7    8     9    10      11
Original input-list: [8,49,73,102,259,762,2782,3383,9217,37846,89487,7471788]
Modified list:       [8,73,94,102,276,592,3338,8227,9217,63784,89487,7887471]
Modified indices:     0  2  1   3   5   4    7    6    8     9    10      11
Equal indices:        ^         ^                      ^     ^     ^       ^

So the output is: 6

1-based indexing:
After rotating each: [8,49,37,021,925,762,2278,3383,2179,37846,94878,8874717]
Sorted again:        [8,(0)21,37,49,762,925,2179,2278,3383,37846,94878,8874717]

Input indices:        1  2  3   4   5   6    7    8    9    10    11      12
Original input-list: [8,49,73,102,259,762,2782,3383,9217,37846,89487,7471788]
Modified list:       [8,21,37,49,762,925,2179,2278,3383,37846,94878,8874717]
Modified indices:     1  4  3  2   6   5    9    7    8    10    11      12
Equal indices:        ^     ^                               ^     ^       ^

So the output is: 5

Challenge rules:

The input-list is guaranteed to only contain positive integers.
The input-list is guaranteed to be sorted from lowest to highest.
The input-list is guaranteed to contain at least two items.
As you can see above, both 0-based and 1-based indexing is allowed. Please state in your answer which of the two you've used, since outputs can differ accordingly!
Leading 0s after rotating are ignored, which can be seen with the 1-based example above, where the integer 102 becomes 021 after rotating, and is then treated as 21.
Integers are guaranteed unique in the input-list, and are guaranteed to remain unique after the rotations are completed.
Note that we only look at the positions of the rotated integers in correlation with the positions of the input, not with the values of the input-list. To clarify what I mean by this: with the input-list [1234,3412] and 1-based indexing, the list becomes [2341,1234] after rotating each integer it's index amount of times, and then when sorted becomes [1234,2341]. Although both the original input-list and the rotated list contains the integer 1234 at the leading position, they aren't the same! The rotated 1234 was 3412 before. The 1-indexed output for this input-list is therefore 0, since the two integers have swapped their positions.
Input is flexible. Can be a list/stream/array of integers/strings/digit-arrays, etc. Please state what you've used if you don't take the inputs as integers.

General rules:

This is code-golf, so shortest answer in bytes wins.
Don't let code-golf languages discourage you from posting answers with non-codegolfing languages. Try to come up with an as short as possible answer for 'any' programming language.
Standard rules apply for your answer with default I/O rules, so you are allowed to use STDIN/STDOUT, functions/method with the proper parameters and return-type, full programs. Your call.
Default Loopholes are forbidden.
If possible, please add a link with a test for your code (i.e. TIO).
Also, adding an explanation for your answer is highly recommended.

Test cases:
Input: [8, 49, 73, 102, 259, 762, 2782, 3383, 9217, 37846, 89487, 7471788]
0-based output: 6
1-based output: 5

Input: [1234, 3412]
0-based output: 2
1-based output: 0

Input: [2349, 2820, 17499, 21244, 29842, 31857, 46645, 56675, 61643, 61787]
0-based output: 3
1-based output: 0

Input: [4976, 11087, 18732, 22643, 52735]
0-based output: 2
1-based output: 3

Input: [4414, 5866, 7175, 8929, 14048, 16228, 16809, 19166, 24408, 25220, 29333, 44274, 47275, 47518, 53355]
0-based output: 4
1-based output: 4

Input: [11205, 16820, 63494]
0-based output: 1
1-based output: 3

Feel free to generate more random test cases with (or draw inspiration from) this ungolfed 05AB1E program, where the input is the size of the random list (NOTE: the output of this generator might not comply with the rule "Integers are guaranteed unique in the input-list, and are guaranteed to remain unique after the rotations are completed", so keep that in mind when using it.)

May we assume that the input has at least 2 elements?

@RobinRyder Hmm, my first thought would be no, but since I don't have any test cases with single items and it won't add much to the challenge, why not. I'll add a rule that the input-list is guaranteed to contain at least 2 items.

May we accept input as a list of strings?

@Shaggy I've notified the answers I thought would benefit from it. If you see any that could benefit from it as well, feel free to notify them as well.

@EmbodimentofIgnorance Yes.

From the example it seems the output should be "The amount of integers which are still at the exact same index, after rotating the digits in each integer its index amount of times towards the left, and sorting the array again"?

@qwr You're indeed correct. Edited.

R, 114 107 bytes
-5 bytes thanks to Giuseppe.
Outgolfed by digEmAll.
function(l){for(j in seq(l))l[j]=rep(l[j]%/%(e=10^(b=nchar(l[j]):1-1))%%10,j+1)[j+0:b]%*%e
sum(sort(l)==l)}

Try it online!
0-indexed.
Ungolfed version:
function(l) {
  n = length(l)                         # size of input
  for (j in 1:n) {
    b = nchar(l[j]) -1                  # number of digits in l[j] -1
    e = 10 ^ (b:0)
    d = l[j] %/% e %% 10                # convert to vector of digits
    l[j] = rep(d, j + 1)[j + 0:b] %*% e # rotate digits and convert back to an integer
  }
  sum(sort(l) == l)                     # number of integers which are in the same position
}

To rotate the b digits of an integer by j positions, the code repeats the digits many times, then takes the digits in positions j+1 to j+b. For instance, to rotate 102 4 times, keep the values marked with an x (positions 5 to 7):
102102102102
    xxx

so the result is 021.

111 bytes

@Giuseppe Thanks! I need to remember seq(a=...).
I expect there is some Map magic to perform, but my attempts left the byte count unchanged at best.

Map might be a bit too expensive since the function boilerplate is at least 9 bytes, but if you switch to 0-indexing, we can do 109 bytes

Good find! Down to 107 by realizing that seq(a=l) can be seq(l) as long as  the input has at least 2 elements (I asked whether this is OK).

Let's change the approach :D

@digEmAll Brilliant! That deserves a separate submission, IMO.

@RobinRyder: yeah, you're probably right... I'll post it separately

05AB1E, 9 bytes
ΣN._ï}-_O

Try it online!
Uses 0-based indexing.
Explanation:
Σ    }       # sort the input by
 N._         # each number rotated its index to the left
    ï        # then cast to int (otherwise the sort is alphabetic)
      -      # subtract the input from the result
       _O    # then count the 0s

Japt -x, 10 9 bytes
0-based
í¶UñÈséYn

Try it
í¶UñÈséYn     :Implicit input of integer array U
í             :Interleave with
  Uñ          :U sorted by
    È         :Passing each integer at 0-based index Y through the following function
     s        :  Convert to string
      é       :  Rotate right by
       Yn     :    Y negated
 ¶            :Reduce each pair by testing for equality
              :Implicit output of sum of resulting array

Python 2, 104 100 97 93 bytes
b=[int((s*-~i)[i:i+len(s)])for i,s in enumerate(input())]
print map(cmp,b,sorted(b)).count(0)

Try it online!
0-based indexing.
First rotates each number, and then compares the result with result, but sorted.

Saved:

-3 bytes, thanks to Erik the Outgolfer
-4 bytes, thanks to Kevin Cruijssen (and his rule-change)

-3 as a full program.

@eriktheoutgolfer thanks, I was too busy trying to make a lambda, that I forgot about input() :)

That's why I first try to make a full program... :D Seriously, if you first try to make a full program, you will then clearly see if it's worth converting to a lambda or not. Don't start with a def right away (they're pretty useless in Python 2, contrary to Python 3).

I've allowed the input-list as strings now, so you can drop 4 bytes by removing the grave accents surrounding the s.

Jelly, 9 bytes
Dṙ"JḌỤ=JS

Try it online!
Monadic link that takes a list of integers and returns an integer indicating the number of integers that remain in place after performing the rotation using 1-indexing.
Explanation
D         | Convert to decimal digits
 ṙ"J      | Rotate left by index
    Ḍ     | Convert back to integer
     Ụ    | Index in sorted list
      =J  | Check if equal to index in original list
        S | Sum

R, 90 88 85 bytes
function(x)sum(rank(as.double(substr(strrep(x,L<-sum(x|1)),y<-1:L,y+nchar(x)-1)))==y)

Try it online!

0-indexed rotation
rotation strategy inspired by @RobinRyder's answer
-5 bytes thanks to @Giuseppe

Unrolled code with explanation :
function(x){
    L=sum(x|1)                         # store the length of x

    R=strrep(x,L)                      # repeat each string of vector x L times

    S=substring(R,1:L,1:L+nchar(x)-1)) # for each string of R, extract a substring of the same
                                       # length of the original number starting from index 1
                                       # for the 1st element, index 2 for the 2nd and so on
                                       # (this basically rotates the strings )

    Y=as.double(S)                     # convert the strings to numbers

    sum(rank(Y)==1:L)                  # return the number of times the ranks of Y
                                       # match with their original positions
}

J, 28 26  bytes
-2 bytes thanks to Jonah
1#.i.@#=[:/:#\".@|.&>":&.>

Try it online!

Nice.  Looks like you can lose the "0 (Try it online!) but other than that I didn't see a way to golf further.

@Jonah Thank you! I don't know why I didn't try without it.

Pyth, 15 bytes
sqVSJ.ev.<`bkQJ

Try it online! Uses 0-based indexing.
sqVSJ.ev.<`bkQJ   Implicit: Q=eval(input())
     .e      Q    Map elements of Q, as b and with index k, using:
          `b        Convert b to string
        .<  k       Rotate the above left k places
       v            Convert back to integer
    J             Store the above as J
   S              Sort the above
 qV           J   Vectorised equality check with the unsorted list
s                 Sum, implicit output

@FryAmTheEggman I've now allowed a list of strings as input, so it's valid now.

@FryAmTheEggman You're probably right, I'd not considered lexographic sorting vs integer sorting when omitting the s - the original version of the code had a v for the same effect. I'll edit it back in

Ah, well as Kevin points out now you could drop the backtick and take the input as a list of strings to save a byte.

JavaScript (Node.js), 107 99 95 bytes
-8 bytes Thanks @Shaggy for accepting array of strings instead. Further golfed 4 bytes from this. Will not trigger memory error this time.
a=>[...b=a.map(F=(x,i)=>i--?F(x.slice(1)+x[c=0],i):x)].sort((p,q)=>q-p).map(x=>c+=x==b.pop())|c

Try it online!
JavaScript (Node.js), 111 107 bytes
-4 bytes Thanks @Arnauld!
a=>[...b=a.map((x,i)=>"".padEnd(x+i,x+=c='').substr(i,x.length))].sort((p,q)=>q-p).map(x=>c-=x==b.pop())|-c

Try it online!
JavaScript (Node.js), 113 111 bytes
a=>[...b=a.map((x,i)=>"".padEnd(x+i,x).substr(i,`${x}`.length))].sort((p,q)=>p-q).map((x,i)=>x-b[i]||c++,c=0)|c

Try it online!
0-indexed. May trigger memory error for very large entries.

99 bytes, taking input as an array of integer strings.

@Shaggy Thanks, and it's now 95 bytes ;)

APL+WIN, 23, 21 19 bytes
2 bytes saved by inputting the integers as a nested vector of characters
+/i=⍋⍎¨(i←⍳⍴v)⌽¨v←⎕

1 indexed.
v←⎕ prompt for input.

(i←⍳⍴v)⌽¨ rotate each set of characters by input indices.

⍋⍎¨ convert characters to integers and get sorted indices.

+/i= sum where original and sorted indices are the same.

Try it online! Courtesy of Dyalog Classic

Not sure if it would save any bytes, but I allowed the input as a list of strings or list of digit-lists now.

@KevinCruijssen Thanks for pointing that out. Inputting a nested vector of strings saves 2 bytes

PHP, 159 141 134 130 bytes
function($a){foreach($a as$x){for($j=$i;$j--;$x=substr($x,1).$x[0]);$b[$x]=$i++;}ksort($b);foreach($b as$z)$y+=++$j==$z;return$y;}

Try it online!
Zero-based indexing.
Ungolfed:
function( $a ) {
    // iterate through digits
    foreach( $a as $x ) {
        // rotate the digits the number of times based on their index
        for( $j = $i; $j--; ) {
            // move first digit to last digit
            $x = substr( $x, 1 ) . $x[0];
        }
        // the new number is used as key for sort, value is the original index
        $b[ $x ] = $i++;
    }
    // sort by the new numbers
    ksort( $b );
    // iterate sorted array
    foreach( $b as $z ) {
        // if new index matches original index, increment count ($y)
        if ( ++$j == $z ) {
            $y++;
        }
    }
    return $y;
}

-4 bytes taking input as array of strings, thx to @KevinCruijssen for pointing that out.

I don't know PHP too well, but I allow a list of strings instead of integers now, so I think you can remove the .=''?

@KevinCruijssen you are correct. Taking as an array of strings will remove that from being necessary. I'll update accordingly.

Stax, 11 10 bytes
ìát'óJ♣á◄·

Run and debug it
This program uses 0-based indexing and takes input as an array of strings.  I saved a byte by taking opportunity of the new input clarificatinos.

Perl 5 -pa, 80 bytes
map$d{$_.substr$_,0,$b%y///c,''}=$b++,@F;$\+=$d{$_}==$r++for sort{$a-$b}keys%d}{

Try it online!
Takes input as space separated numbers on STDIN; gives 1-based result.

K (Kona), 25 21bytes
-4 bytes thanks to ngn!
{+/t=<.:'(t:!#x)!'$x}

Try it online!

{.:y!x}'[$x;t:!#x] -> .:'(t:!#x)!'$x

@ngn Thank you, it's much better now!

T-SQL query, 99 bytes
Sql has no rotating method, so I had to implement my own syntax, since this is a query, it had to be done without looping.
0-based indexing.
Using a table variable as input.
SELECT-sum(1/~(z*3))FROM(SELECT~i+rank()over(order by
substring(n+n,i%len(n)+1,len(n))*1)z FROM @)c

Try it online

Perl 6, 50 bytes
{sum ^$_ Z==sort {+[~] rotate .[$^i].comb,$i},^$_}

Try it online!
0-based indexing. Also exposed a Rakudo bug.
Explanation
{                                                }  # Anonymous block
            sort                              ^$_   # Sort indices 0..n
                 {                          },  # by
                              .[$^i]            # element at index i
                                    .comb       # split into chars
                       rotate            ,$i    # rotated i times
                   [~]  # joined
                  +     # converted to number
     ^$_ Z==  # Pairwise equal to original indices 0..n
 sum   # Sum of equal indices

Icon, 141 bytes
procedure f(l)
n:=0
b:=[]
t:=l[k:=1to*l]&m:=k%*t&t:=t[m+1:0]||t[1:m+1]&put(b,[+t,l[k]])&\x
l[i:=1to*l]=sortf(b,1)[i,2]&n+:=1&\x
return n
end

Try it online!
1-based indexing

Perl 5, 104 bytes
sub f{my$i;grep/\d+$/&&$i++==$&,sort{$a<=>$b}map{my$n=shift;map$n=~s/(.)(.+)/$2$1/,1..$_;"$n.$_"}0..$#_}

Try it online!
0-based indexing in Perl. Ungolfed and commented:
sub f {
  my $i;                            #index counter
  grep /\d+$/ && $i++==$&,          #keep/return elems where $i matches original index stored as decimals
  sort { $a<=>$b }                  #sort rotated elems numerically (<=> is the numerical comparison op
  map {                             #loop through input
    my $n = shift;                  #shift(@_) got elem from input array @_
    map $n=~s/(.)(.+)/$2$1/, 1..$_; #rotate left times current index
    "$n.$_"                         #use rotated number with original index number as decimals (to dont affect sort)
  }
  0..$#_
}

Ruby -ap, 77 bytes
1-indexed. Was temp deleted earlier because I missed part of the spec.
-p reads a line of STDIN, and outputs $_ at the end. -a splits that read line by spaces and saves it as $F.
i=0
$_=$F.zip($F.sort_by{|s|s.chars.rotate(i+=1).join.to_i}).count{|a,b|a==b}

Try it online!

you can save 2 bytes by replacing [...].join.to_i with eval [...]*''

@Doorknob unfortunately not... there are edge cases where if a number is rotated to have a leading zero, eval will interpret it as a base-8 number, which could mess up our counts...

Scala, 200 160 bytes
def f(a:Seq[String])=
  a.zipWithIndex
   .map(x=>{val r=x._2%x._1.size;x._1.drop(r)+x._1.take(r)->x._2})
   .sortBy(_._1.toInt)
   .zipWithIndex
   .filter(x=>x._1._2==x._2)
   .size

Try it online!
0-indexed. 160 chars after removing indentation and newlines. This prints 6:
println( f(Seq("8","49","73","102","259","762","2782","3383","9217","37846","89487","7471788")) )

Wolfram Language (Mathematica), 65 bytes
o=Ordering
g=Count[o@MapIndexed[FromDigits@*RotateLeft,#]-o@#,0]&

Try it online!
1-based. We take the input as a list of digit lists, which works because Mathematica orders lists by length, then lexicographically, i.e. just like the original numbers.

Bash, 204 201 bytes
The only interesting thing here (possibly) is the use of eval.  The algorithm is also clunky in that it creates a sorted list then reads it in order to determine changed index/indices.
1-based solution. My thanks to @RobinRyder for the helpful rotation algorithm.

for((i=1;i<$#+1;i++));do eval s=\${$i};for((j=0;j<i;j++));do eval s=${s}\${$i};done;eval n=\${s:$i:\${#$i}};echo $n $i;done|sort -nk1,1|{ i=1;c=0;while read d j;do((i==j))&&((c++));((i++));done;echo $c; }

Try it online!
Revised code following Kevin's comments;
Try it online!

I don't know Bash too well, but I think you can remove the last space between ;}. Also, you can change your first loop to for((i=0;++i<=$#;));.

@KevinCruijssen -- usually I have found Bash and friends needs that space to parse the command line.  On this occasion you are correct it may be removed. Nice idea to re-base and pre-increment. 202 bytes.

Vyxal, 12 bytes
µ¥Ǔ&›₀β;=';L

Try it Online!
µ      ;     # Sort by...
 ¥           # Register
  Ǔ          # Shift right by
   &›        # Increment register
     ₀β      # Cast to int
        =';L # Find those where they're equal


text:
Generate a Graeco-Latin square
 disclaimer: I'm not aware of any non-bruteforce solutions
A Graeco-Latin square is, for two sets of same length \$n\$, a \$n \times n\$ arrangement of cells, each containing a unique (across the entire square) pair of a element of the first set and a element of the second set, such that all first elements and all second elements of the pairs are unique in their row and column. The most common sets used are, as one could guess, the first \$n\$ letters of the Greek and the Latin alphabets.
Here is a picture of a 4x4 Graeco-Latin square:
Graeco-Latin squares are as useful as they sound (the Wikipedia article mentions "design of experiments, tournament scheduling and constructing magic squares"). Your task is, given a positive integer \$n\$, to generate a \$n\times n\$ Graeco-Latin square.
Input
A positive integer \$n > 2\$; it is guaranteed that a \$n\times n\$ Graeco-Latin square exists (that is, \$n \ne 6\$).
Output
A Graeco-Latin square with side length n as a two-dimensional array, a array of arrays, a flattened array or outputted directly.
Notes

You do not have to use the Greek and Latin alphabets specifically; for example, outputting pairs of positive integers is allowed as well.
If you choose to use a alphabet that can't be extended arbitrarily, you have to (theoretically; your code doesn't have to finish before the heat death of the universe) support a maximal side length of at least 20.

This is code-golf, so the shortest code wins!

Sandbox link

Do we have to output a single square, or is it ok to output all possible squares as a list?

Jelly,  21  20 bytes
-1 thanks to Nick Kennedy (flat output option allows a byte save of ż"þ`ẎẎQƑ$Ƈ \$\rightarrow\$ F€p`Z€QƑƇ)
Œ!ṗ⁸Z€Q€ƑƇF€p`Z€QƑƇḢ

Try it online! (Too slow for 4 in 60s on TIO, but if we replace the Cartesian power, ṗ, with Combinations, œc, it will complete - although 5 certainly will not!)
How?
Œ!ṗ⁸Z€Q€ƑƇF€p`Z€QƑƇḢ - Link: integer, n
Œ!                   - all permutations of [1..n]
   ⁸                 - chain's left argument, n
  ṗ                  - Cartesian power (that is, all ways to pick n of those permutations, with replacement, not ignoring order)
    Z€               - transpose each
         Ƈ           - filter, keeping those for which:
        Ƒ            -   invariant under:
      Q€             -     de-duplicate each
          F€         - flatten each
             `       - use this as both arguments of:
            p        -   Cartesian product
              Z€     - transpose each
                  Ƈ  - filter, keeping those for which:
                 Ƒ   -   invariant under:
                Q    -     de-duplicate (i.e. contains all the possible pairs)
                   Ḣ - head (just one of the Latin-Greaco squares we've found)

Here's a 20. I originally wrote this independently of yours, but ended up with something pretty similar, and then took some inspiration from your use of Cartesian power in place of a permutation dyad, so it's probably best to use it to improve yours. Note you've misspelled Graeco in your explanation.

Thanks Nick, I didn't notice we were allowed to output a flattened version.

05AB1E, 26 23 22 bytes
-3 bytes thanks to Emigna
-1 byte thanks to Kevin Cruijssen
Lãœ.ΔIôDζ«D€í«ε€нÙgQ}P

Try it online!

n<ÝI‰ can be <Ýã

...and <Ý can be L. Thanks!

ê}DIùQ can be ÙgQ}P to save a byte.

@KevinCruijssen thanks! I edited that in.

R, 164 148 bytes
-many bytes thanks to Giuseppe.
n=scan()
`!`=function(x)sd(colSums(2^x))
m=function()matrix(sample(n,n^2,1),n)
while(T)T=!(l=m())|!(g=m())|!t(l)|!t(g)|1-all(1:n^2%in%(n*l+g-n))
l
g

Try it online!
Dramatically inefficient - I think it's even worse than other brute force approaches. Even for n=3, it will probably time out on TIO. Here is an alternate version (155 bytes) which works for n=3 in about 1 second.
Works by rejection. The function m draws a random matrix of integers between \$1\$ and \$n\$ (without forcing each integer to appear exactly \$n\$ times, or in different columns - this explains the slowness of the code, and is the only thing changed in the faster version). Call this function twice, to get the "latin" and "greek" squares l and g. Then we check:

all(1:n^2%in%(n*l+g-n)): are there \$n^2\$ different
pairs of values in l \$\times\$ g?
are l and g latin squares?

To check that a matrix is a latin square, use the function !. Since point 1. above has been validated, we know that each integer appears \$n\$ times in each of l and g. Compute the column-wise sums of 2^l: these sums are all equal if and only if each integer appears once in each column (and the value of the sum is then \$2^{n+1}-2\$). If this is true for both l and its transpose t(l), then l is a latin square; same for g. The function sd, which computes the standard deviation, is an easy way to check whether all values of a vector are equal. Note that it doesn't work for the trivial cases \$n=0\$ and \$n=1\$ , which is OK according to the OP.
A final note: as often in R code golf, I used the variable T, which is initialized as TRUE, to gain a few bytes. But this means that when I needed the actual value TRUE in the definition of m (parameter replace in sample), I had to use 1 instead of T. Similarly, since I am redefining ! as a function different from negation, I had to use 1-all(...) instead of !all(...).

JavaScript (ES6),  159 147  140 bytes
Returns a flat array of \$n\times n\$ pairs of non-negative integers.
This is a simple brute force search, and therefore very slow.
n=>(g=(m,j=0,X=n*n)=>j<n*n?!X--||m.some(([x,y],i)=>(X==x)+(Y==y)>(j/n^i/n&&j%n!=i%n),g(m,j,X),Y=X/n|0,X%=n)?o:g([...m,[X,Y]],j+1):o=m)(o=[])

Try it online! (with prettified output)
Commented
n => (                      // n = input
  g = (                     // g is the recursive search function taking:
    m,                      //   m[] = flattened matrix
    j = 0,                  //   j   = current position in m[]
    X = n * n               //   X   = counter used to compute the current pair
  ) =>                      //
    j < n * n ?             // if j is less than n²:
      !X-- ||               //   abort right away if X is equal to 0; decrement X
      m.some(([x, y], i) => //   for each pair [x, y] at position i in m[]:
        (X == x) +          //     yield 1 if X is equal to x OR Y is equal to y
        (Y == y)            //     yield 2 if both values are equal
                            //     or yield 0 otherwise
        >                   //     test whether the above result is greater than:
        ( j / n ^ i / n &&  //       - 1 if i and j are neither on the same row
          j % n != i % n    //         nor the same column
        ),                  //       - 0 otherwise
                            //     initialization of some():
        g(m, j, X),         //       do a recursive call with all parameters unchanged
        Y = X / n | 0,      //       start with Y = floor(X / n)
        X %= n              //       and X = X % n
      ) ?                   //   end of some(); if it's falsy (or X was equal to 0):
        o                   //     just return o[]
      :                     //   else:
        g(                  //     do a recursive call:
          [...m, [X, Y]],   //       append [X, Y] to m[]
          j + 1             //       increment j
        )                   //     end of recursive call
    :                       // else:
      o = m                 //   success: update o[] to m[]
)(o = [])                   // initial call to g with m = o = []

144? (On my phone, so not entirely sure it works)

I don't think you need o, either; you can just return m at the end for 141

@Shaggy Both versions would fail for $n=5$ (probably because it's the first size where we actually need to backtrack -- but I didn't really check).

Haskell, 207 143 233 bytes
(p,q)!(a,b)=p/=a&&q/=b
e=filter
f n|l<-[1..n]=head$0#[(c,k)|c<-l,k<-l]$[]where
	((i,j)%p)m|j==n=[[]]|1>0=[q:r|q<-p,all(q!)[m!!a!!j|a<-[0..i-1]],r<-(i,j+1)%e(q!)p$m]
	(i#p)m|i==n=[[]]|1>0=[r:o|r<-(i,0)%p$m,o<-(i+1)#e(`notElem`r)p$r:m]

Try it online!
OK, I think I finally got it this time. It works fine for n=5, n=6 times out on TIO but I think that might just be because this new algorithm is INCREDIBLY inefficient and basically checks all possibilities until it finds one that works. I'm running n=6 on my laptop now to see if it terminates with some more time.
Thanks again to @someone for pointing out the bugs in my previous versions

I do not know Haskell, but this seems to error for me when I change the "4" in the footer to 5. Am I invoking this correctly?

@someone Good catch, I should've tested that.I'm actually not sure what's going wrong here, this might take a while to debug

I think this still has a bug; when run for n=5, the tuple (1,1) appears twice.

@someone Man, this problem is a lot harder than I thought. I just can't find a reliable way to lock down all the constraints at once. As soon as I focus on one another one slips out of my grasp. I'm going to mark as non-competing for now until I can find some more time to work on this. Sorry for not testing as thoroughly as I should have

Haskell, 187 bytes
import Data.List
import Data.List.Split
t=transpose
c a e h=[s|p<-a,s<-c(a\\[p])(e++[p])h,and[r==nub r|d<-h<$>t s,m<-[d,t d],r<-m]]++[e]
f n=head$c[[a,b]|a<-[1..n],b<-[1..n]][]$chunksOf n

Try it online!
This is equivalent to a DFS Brute-Force Approach. Times out for n>3 on TIO, so only n=1 and n=3 work correctly.
Explanation
import Data.List -- used for nub, transpose, and difference (\\)
import Data.List.Split -- used for chunksOf, shorter than a custom definition using splitAt or take/drop
-- we store each pair as [a,b]::[Int] instead of (a,b)::(Int,Int) to save bytes
t=transpose
-- c :: [[Int]] -> [[Int]] -> Int -> [[[Int]]]
-- recursive algorithm that yields a (lazy) list of all possible GL squares using
--  a = available pairs left (avoids duplicates)
--  e = existing square state, flattened (first `length e` pairs of the square in LTR reading order)
--  h = chunksOf n
c a e h=[
  s| -- where each possible square comes from
  p<-a, -- some available pair to add
  s<-c -- each square comes from recursion with
    (a\\[p]) -- that pair taken from the list of available pairs
    (e++[p]) -- that pair added to the existing square state
    h,
  and[r==nub r|  -- such that every "row" contains no duplicates
    d<-h<$>t s, -- d<-(list of [the rows of the first element of each pair, the rows of the second element of each pair])
    m<-[d,t d], -- m<-(rows of the square, columns of the square)
    r<-m -- row r<-m
    ]
  ]
  ++[e] -- base case: only reached if a==[] or if no valid possibilities exist (n==2 || n==6, not required to be handled)
f :: Int -> [[Int]]
f n=head$c -- the first valid GL square found from the initial conditions:
  [[a,b]|a<-[1..n],b<-[1..n]] -- all possible pairs
  [] -- empty existing GL square
  $chunksOf n -- given chunksOf function

C#, 520 506 494 484 bytes
class P{static void Main(string[]a){int n=int.Parse(a[0]);int[,,]m=new int[n,n,2];int i=n,j,k,p,I,J;R:for(;i-->0;)for(j=n;j-->0;)for(k=2;k-->0;)if((m[i,j,k]=(m[i,j,k]+ 1) % n)!=0)goto Q;Q:for(i=n;i-->0;)for(j=n;j-->0;){for(k=2;k-->0;)for(p=n;p-->0;)if(p!=i&&m[i,j,k]==m[p,j,k]||p!=j&&m[i,j,k]==m[i,p,k])goto R;for(I=i;I<n;I++)for(J=0;J<n;J++)if(I!=i&&J!=j&&m[i,j,0]==m[I,J,0]&&m[i,j,1]==m[I,J,1])goto R;}for(i=n;i-->0;)for(j=n;j-->0;)System.Console.Write(m[i,j,0]+"-"+m[i,j,1]+" ");}}

The algorithm of findinf a square is very simple. It is... bruteforce. Yeah, it's stupid, but code golf is not about speed of a program, right?
The code before making it shorter:
using System;

public class Program
{
    static int[,,] Next(int[,,] m, int n){
        for (int i = 0; i < n; i++)
        {
            for (int j = 0; j < n; j++)
            {
                for (int k = 0; k < 2; k++)
                {
                    if ((m[i, j, k] = (m[i, j, k] + 1) % n) != 0)
                    {
                        return m;
                    }
                }
            }
        }
        return m;
    }
    static bool Check(int[,,] m, int n)
    {
        for (int i = 0; i < n; i++)
        {
            for (int j = 0; j < n; j++)
            {
                for (int k = 0; k < 2; k++)
                {
                    for (int p = 0; p < n; p++)
                    {
                        if (p != i)
                            if (m[i, j, k] == m[p, j, k])
                                return false;
                    }
                    for (int p = 0; p < n; p++)
                    {
                        if (p != j)
                            if (m[i, j, k] == m[i, p, k])
                                return false;
                    }
                }
            }
        }

        for (int i_1 = 0; i_1 < n; i_1++)
        {
            for (int j_1 = 0; j_1 < n; j_1++)
            {
                int i_2 = i_1;
                for (int j_2 = j_1 + 1; j_2 < n; j_2++)
                {
                    if (m[i_1, j_1, 0] == m[i_2, j_2, 0] && m[i_1, j_1, 1] == m[i_2, j_2, 1])
                        return false;
                }
                for (i_2 = i_1 + 1; i_2 < n; i_2++)
                {
                    for (int j_2 = 0; j_2 < n; j_2++)
                    {
                        if (m[i_1, j_1, 0] == m[i_2, j_2, 0] && m[i_1, j_1, 1] == m[i_2, j_2, 1])
                            return false;
                    }
                }
            }
        }
        return true;
    }
    public static void Main()
    {
        int n = 3;
        Console.WriteLine(n);
        int maxi = (int)System.Math.Pow((double)n, (double)n*n*2);
        int[,,] m = new int[n, n, 2];
        Debug(m, n);
        do
        {
            m = Next(m, n);
            if (m == null)
            {
                Console.WriteLine("!");
                return;
            }
            Console.WriteLine(maxi--);
        } while (!Check(m, n));

        Debug(m, n);
    }

    static void Debug(int[,,] m, int n)
    {
        for (int i = 0; i < n; i++)
        {
            for (int j = 0; j < n; j++)
            {
                Console.Write(m[i, j, 0] + "-" + m[i, j, 1] + " ");
            }
            Console.WriteLine();
        }
        Console.WriteLine();
    }
}

Now, if you want to test it with n=3 you wil have to wait like an hour, so here is another version:
public static void Main()
{
    int n = 3;
    Console.WriteLine(n);
    int maxi = (int)System.Math.Pow((double)n, (double)n*n*2);
    int[,,] result = new int[n, n, 2];
    Parallel.For(0, n, (I) =>
    {
        int[,,] m = new int[n, n, 2];
        for (int i = 0; i < n; i++)
            for (int j = 0; j < n; j++)
            {
                m[i, j, 0] = I;
                m[i, j, 1] = I;
            }
        while (true)
        {
            m = Next(m, n);
            if (Equals(m, n, I + 1))
            {
                break;
            }
            if (Check(m, n))
            {
                Debug(m, n);
            }
        }
    });
}

Update: forgot to remove "public".
Update: used "System." instead of "using System;"; Also, thanks to Kevin Cruijssen, used "a" instead of "args".
Update: thanks to gastropner and someone.

args can be a :)

Each for loop could be transformed from for(X = 0; X < Y; X++) to for(X = Y; X-->0; ), which should save a byte per loop.

Have you tried the Visual C# Interactive Compiler? It can save bytes. You can also submit a anonymous function. You can also assign i = 0 in the defininion of i and save a byte.

405 bytes based on @someone's suggestion. Of course it times out after 60 sec on TIO, but it does save bytes by using a lambda and the Interactive Compiler with implicit System. Also, if((m[i,j,k]=(m[i,j,k]+ 1) % n)!=0) can be if((m[i,j,k]=-~m[i,j,k]%n)>0).

@Kevin I don't really feel like reading through that code trying to golf it. Are you sure the printing part works right? It looks like it either should use Write or could save bytes by adding \n to the string inside the call or is otherwise broken. I think you can also return a array directly.

@someone I know what you mean. I only looked for the easiest golfs. I'm sure the amount of loops can somehow be reduced as well, and something else besides the goto could be used perhaps (I now see that goto Q;Q: can be probably be removed, so the if continues into more nested loops), so only the goto R remains). Since the code runs in about 60 minutes, I haven't tested it either, and am not entirely sure what it prints and if everything is correctly tbh.

Octave, 182 bytes
Brute force method, TIO keeps timing out and I had to run it a bunch of times to get output for n=3, but theoretically this should be fine.  Instead of pairs like (1,2) it outputs a matrix of complex conjugates like 1+2i.  This might be stretching the rule a bit, but in my opinion it stll fits the output requirements.  There must be a better way to do the two lines under the functino declaration though, but I'm not sure at the moment.

function[c]=f(n)
c=[0,0]
while(numel(c)>length(unique(c))||range([imag(sum(c)),imag(sum(c.')),real(sum(c)),real(sum(c.'))])>0)
a=fix(rand(n,n)*n);b=fix(rand(n,n)*n);c=a+1i*b;
end
end

Try it online!

Wolfram Language (Mathematica), 123 bytes
P=Permutations
T=Transpose
g:=#&@@Select[T[Intersection[x=P[P@Range@#,{#}],T/@x]~Tuples~2,2<->4],DuplicateFreeQ[Join@@#]&]&

Try it online!
I use TwoWayRule notation Transpose[...,2<->4] to swap the 2nd and 4th dimensions of an array; otherwise this is fairly straightforward.
Ungolfed:
(* get all n-tuples of permutations *)
semiLSqs[n_] := Permutations@Range@n // Permutations[#, {n}] &;

(* Keep only the Latin squares *)
LSqs[n_] := semiLSqs[n] // Intersection[#, Transpose /@ #] &;

isGLSq[a_] := Join @@ a // DeleteDuplicates@# == # &;

(* Generate Graeco-Latin Squares from all pairs of Latin squares *)
GLSqs[n_] :=
  Tuples[LSqs[n], 2] // Transpose[#, 2 <-> 4] & // Select[isGLSq];

Python 3, 271 267 241 bytes
Brute-force approach: Generate all permutations of the pairs until a Graeco-Latin square is found. Too slow to generate anything larger than n=3 on TIO.
Thanks to alexz02 for golfing 26 bytes and to ceilingcat for golfing 4 bytes.
Try it online!
from itertools import*
def f(n):
 s=range(n);l=len
 for r in permutations(product(s,s)):
  if all([l({x[0]for x in r[i*n:-~i*n]})*l({x[1]for x in r[i*n:-~i*n]})*l({r[j*n+i][0]for j in s})*l({r[j*n+i][1]for j in s})==n**4for i in s]):return r

Explanation:
from itertools import *  # We will be using itertools.permutations and itertools.product
def f(n):  # Function taking the side length as a parameter
 s = range(n)  # Generate all the numbers from 0 to n-1
 l = len  # Shortcut to compute size of sets
 for r in permutations(product(s, s)):  # Generate all permutations of all pairs (Cartesian product) of those numbers, for each permutation:
  if all([l({x[0] for x in r[i * n : (- ~ i) * n]})  # If the first number is unique in row i ...
        * l({x[1] for x in r[i * n:(- ~ i) * n]})  # ... and the second number is unique in row i ...
        * l({r[j * n + i][0] for j in s})  # ... and the first number is unique in column i ...
        * l({r[j * n + i][1] for j in s})  # ... and the second number is unique in column i ...
        == n ** 4 for i in s]):  # ... in all columns i:
   return r  # Return the square

-26 bytes

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes


text:
Overlapping String-Blocks
Challenge:
Given a list of multi-line strings, overlap them (in the top-left) and output the result.
Example:
Input: ["aaaa\naaaa\naaaa\naaaa","bb\nbb\nbb","c"]
Output:
cbaa
bbaa
bbaa
aaaa

Challenge rules:

Input-format is flexible. You are allowed to get the input as a 2D list of lines (i.e. [["aaaa","aaaa","aaaa","aaaa"],["bb","bb","bb"],["c"]]) or 3D list of characters (i.e. [[["a","a","a","a"],["a","a","a","a"],["a","a","a","a"],["a","a","a","a"]],[["b","b"],["b","b"],["b","b"]],[["c"]]]). You are allowed to take all the inputs one by one through STDIN. Etc.
Output format is strict. You can choose to print or return the multi-line string. (If your language doesn't have any strings, outputting as a 2D list of characters is allowed as alternative. But only if your language doesn't have strings at all.)
The order of the input-list is of course important (but you are allowed to take the input in reverse if you choose to).
Inputs will only contain printable ASCII in the unicode range \$[33,126]\$ (!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~).
Inputs will only be rectangles (so no weird shapes). The output aren't necessary rectangles, though.
Trailing spaces and a single trailing newline is allowed. Leading spaces and/or newlines not.

General rules:

This is code-golf, so shortest answer in bytes wins.
Don't let code-golf languages discourage you from posting answers with non-codegolfing languages. Try to come up with an as short as possible answer for 'any' programming language.
Standard rules apply for your answer with default I/O rules, so you are allowed to use STDIN/STDOUT, functions/method with the proper parameters and return-type, full programs. Your call.
Default Loopholes are forbidden.
If possible, please add a link with a test for your code (i.e. TIO).
Also, adding an explanation for your answer is highly recommended.

Test cases:
Input: ["aaaa\naaaa\naaaa\naaaa","bb\nbb\nbb","c"]
Output:
cbaa
bbaa
bbaa
aaaa

Input: ["12345\n54321","00\n00\n00\n00","001\n011\n012"]
Output:
00145
01121
012
00

Input: ["sm\noo\nmr\nee\nt!\nh_\ni_\nn_\ng_","!@#$%^\n&*()_+\nqwerty\nuiopas","this\nis_a\ntest"]
Output:
this%^
is_a_+
testty
uiopas
t!
h_
i_
n_
g_

Are trailing newlines allowed? Or more specifically, is an arbitrary amount of trailing newlines allowed?

@JAD Yeah sure, why not. As long as the rest is output without any leading spaces/newlines. Trailing newlines/spaces aren't really important, so can optionally be added.

Jelly, 3 bytes
a/Y

Try it online!
Hadn't used Jelly in a while but I thought the challenge in the comments was beatable. Very directly uses logical and (a) to perform the stacking operation between each element of the input (/). Y is used to print in the required format.

Ah nice! I'm pretty bad with Jelly tbh. My prepared solution was ḷ""/Y with a reversed input-list. Didn't even knew about a..

JavaScript (Node.js), 24 bytes
Saved 2 bytes thanks to @Grimy
Assumes that the returned string is printed on a terminal that supports ANSI escape codes. Contains the unprintable character ESC, which is escaped (no pun intended) as \x1B below.
a=>`\x1B[2J\x1B[H`+a.join`\x1B[H`

This doesn't work on TIO, but you can Try it online! to see the raw output instead.
How?
The CSI sequences used are:

ED (Erase in Display):
ESC[2J
where \$2\$ means "clear entire screen"
CUP (Cursor Position):
ESC[H
which means "moves the cursor to row \$n\$, column \$m\$" where both \$n\$ and \$m\$ are omitted and implicitly set to \$1\$ (top-left corner of the screen).

Example output

Assuming an ECMA-48 compliant terminal, you can omit both ;. Also, I think this should be "JavaScript + terminal" or something similar that doesn't compete with pure JavaScript.

@Grimy Thanks! (For anyone interested, here is the ECMA-48 specification -- but I didn't find where it's mentioned that the semicolon can be omitted -- if it's mentioned at all.)

5.4.2.h is somewhat confusingly worded, but the interesting bit is: if the last parameter sub-string(s) is empty, the separator preceding it may be omitted. Since there are only two sub-strings, the separator preceding the last substring is the only one, and it can be omitted.

I don't know ANSI, but is the first \x1B[H+ necessary? Isn't it starting at the top-left by default, and you only need to reset it after each input (which is what join does)? Or does it initially start somewhere else by default, and you have to explicitly let it start at that cursor position for it to successfully reset to that position in the join?

@KevinCruijssen By default it starts wherever the cursor is, typically at the start of a new line after the current prompt + command. Just try on TIO and copy-paste the output to a terminal to see what I mean.

@Grimy Ah ok. I indeed saw the CUP mentioned, but didn't knew it was the mouse cursor. Thought it might have been the typing cursor. I don't know the meta, but I guess we can't assume the mouse cursor is at the top-left, can we? ;)

@KevinCruijssen I do mean the typing cursor, not the mouse cursor. Running a command in a terminal typically requires typing it, which leaves the typing cursor not at the top left.

Isn't meta-consensus that functions should be reusable? Since the ANSI escape sequence sets the cursor to the top left corner, future calls to the function will overlay the new output on top of old outputs, producing invalid output

@EmbodimentofIgnorance Chances are that the terminal is not fully cleared on the first call either, so this is not really a problem of reusability, but rather a problem of output readability. I honestly don't know which rule(s) should be applied here. Also, I was half-tempted to omit the print() in the function entirely and just return the string -- but I don't know if that would be allowed.

@Arnauld Since you probably will always have something else on the terminal when executing this function, I guess the initial reset is required after all. As for ommitting print, I guess f=a=>print(`\x1B[H`+a.join`\x1B[H`) with f(input_here) would produce the same output as print(f(input_here))? So I don't see why you wouldn't be allowed to omit the print and simply return a string.

@KevinCruijssen Thank you. I've updated the answer accordingly. (The screen is now cleared.)

R, 120, 111 110 107 bytes
function(x,`!`=ncol,M=array('',Reduce(pmax,Map(dim,x)))){for(m in x)M[1:!t(m),1:!m]=m
write(t(M),1,!M,,'')}

Try it online!
A function accepting a list of matrix of characters (3D input is accepted).
(as you can notice from the byte count, this is not very easy to do in R...)

-9 bytes thanks to @Giuseppe
-4 bytes thanks to @RobinRyder

I was really expecting a 200+ byte solution! I'll be giving this a nice bounty whenever this question becomes bounty eligibile

@Giuseppe: still much longer than other languages ... :(

111 bytes using array instead of matrix!

@Giuseppe: neat !

110 by switching back to good old ncol and nrow.

@RobinRyder: thanks ! I started using dim everywhere in order to replace it with some alias, but I ended up with more bytes :D

107 with an alias for ncol (you can transpose to get nrow).

107, different solution, same bytecount. :)

Python 2, 88 bytes
n,f=None,filter
for l in map(n,*input()):print''.join(f(n,x)[-1]for x in map(n,*f(n,l)))

Try it online!

Explanation (with example):
Takes a 2D list as input.
Input: [["12345","54321"],["00","00","00","00"],["001","011","012"]]

First the input list is zipped, to get the rows of each input rectangle (map(None,l) is the same a zip longest):
map(n,*input())   gives:

('12345', '00', '001')
('54321', '00', '011')
(None, '00', '012')
(None, '00', None)

Each of these rows are then filtered to removed Nones, and zipped again:
map(None,*filter(None,l))

filter(None,l) for each l gives:

('12345', '00', '001')
('54321', '00', '011')
('00', '012')
('00',)

map*... gives:

[('1', '0', '0'), ('2', '0', '0'), ('3', None, '1'), ('4', None, None), ('5', None, None)]
[('5', '0', '0'), ('4', '0', '1'), ('3', None, '1'), ('2', None, None), ('1', None, None)]
[('0', '0'), ('0', '1'), (None, '2')]
['0', '0']

Which is a list of characters for each position of the desired result. These lists are filtered again, and the last one is taken:
filter(None,x)   gives:

[('1', '0', '0'), ('2', '0', '0'), ('3', '1'), ('4',), ('5',)]
[('5', '0', '0'), ('4', '0', '1'), ('3', '1'), ('2',), ('1',)]
[('0', '0'), ('0', '1'), ('2',)]
['0', '0']

and with [-1]:

['0', '0', '1', '4', '5']
['0', '1', '1', '2', '1']
['0', '1', '2']
['0', '0']

Lastly the resulting lists are joined and printed:
print''.join(..)

00145
01121
012
00

RE "Returns a list of strings", the rules state "Output format is strict. You can choose to print or return the multi-line string. 2D or 3D lists as outputs aren't allowed.". The 88 byte full program seems fine though

@JonathanAllan, welp, I misread the strict output (or forgot? :p)

R, 107 97 bytes
function(x)for(i in 1:max(lengths(x))){for(m in x)if(i<=length(m))cat(m[i],'\r',sep='');cat('
')}

Doesn't appear to work on TIO, which might be related to the use of the \r carriage return character. It does work on my local installation of R.
Takes input as a list containing a vector of rows:
x <- list(c("aaaa","aaaa","aaaa","aaaa"),c("bb","bb","bb"),c("c"))

Loops over the rows of each rectangle, printing a carriage return after each, restarting the line.
If we stretch the rules a little, we can do away with checking the length of the input and just loop infinitely, printing a huge amount of newlines:
R, 85 bytes
function(x)for(i in 1:8e8){for(m in x)if(i<=length(m))cat(m[i],'\r',sep='');cat('
')}

106 bytes Nice to see you doing a golf here and there!

Possibly 97 bytes; unclear if this actually works since I'm only testing in TIO

@Giuseppe Hi! Your suggestion works for me. If we are allowed to print trailing newlines, it's also possible to just use an arbitrarily big for loop instead, but I guess that's pushing the limits of the challenge.

@JAD: great idea using \r, and welcome back! Just a note, I think this works only in interactive R sessions (when interactive() returns true)

@digEmAll It works on my machine using rscript from commandline. I suspect it's a Windows/Linux thing, since Windows uses \r\n for newlines and Linux \n.

@JAD: oh, I would have bet on the interactive thing... but then it's probably that

@digEmAll it might also depend on the console it's being ran in. CMD and powershell deal with the \r as intended. It might be that other environments (like TIO) interpret it as a newline. May I ask what you are running it in?

@digEmAll: rstudio on windows

@digEmAll well..... that's odd. It works for me there :O

@JAD: yes, it works for me too... I was just trying to understand why it does not work on TIO ;)

@digEmAll ah, right.

Let us continue this discussion in chat.

APL (Dyalog Unicode), 22 bytesSBCS
Anonymous tacit prefix function taking list of 2D character arrays as argument. Prints.
(⊃{⍺@(⍳⍴⍺)⊢⍵}/)⌽,∘⊂1⌷↑

Try it online!
This works by creating a canvas, then appending that to the list of blocks, and reducing (folding) with a function that places blocks in the corner.
↑ mix the 2D block to create an orthogonal 3D block, padding them with spaces as needed
1⌷ take the first layer
⊂ enclose that
 ∘ then
⌽, prepend the reversed list of blocks
(…) apply the following tacit function:
 {…}/ reduce using the following anonymous lambda:
  ⊢⍵ with the right argument as canvas…
  ⍺@(…) amend with the elements of the left argument, placed at the following indices:
   ⍴⍺ the shape of the left argument
   ⍳ the ɩndices of an array of that shape
 ⊃ disclose (because the reduction enclosed to reduce rank)

Haskell, 66 bytes
unlines.foldl((const?)?)[]
(g?(a:b))(c:d)=g a c:(g?b)d;(_?a)b=a++b

Input is taken as a list of list of strings in reverse order, e.g. for the first test case: [["c"],["bb","bb","bb"],["aaaa","aaaa","aaaa","aaaa"]].
Try it online!

05AB1E, 12 bytes
Port of TFeld's python solution
2 bytes saved thanks to Grimy
ζεðKζðδK€θJ,

Try it online!
Explanation
ζ             # transpose input with space as filler
 ε            # apply to each
  ðK          # remove spaces
    ζ         # transpose with space as filler
     ðδK      # deep remove spaces
        €θ    # get the tail of each
          J   # join each
           ,  # print

Alternative 14 byte version
õζεÅ»DŠg.$J}θ,

Try it online!
Explanation
õζ              # zip with empty string as filler
  ε             # apply to each
   Å»      }    # cumulative reduce by
     D          # duplicate second input
      Š         # move down twice on stack
       g.$      # remove len(other_copy) elements from the other input
          J     # join with other copy
            θ,  # print the last element

Oh, need to remember that --no-lazy is the fix to still use a map/filter with print for the implicit y, to save a byte in comparison to vy..., :) I knew that worked in the legacy version, but in the new version it would also output the [...]. Didn't knew that was due to the lack of --no-lazy. ;) As for the answer itself, very nice! I knew a cumulative reduce was necessary, but couldn't really work it out when I tried it myself. You make it look so easy..

I had it mentioned in the rules, but forgot to apply it to the test cases.., but spaces won't be in the input. So you can probably save some bytes there since the zip-filler is a space by default. (Not sure if it saves anything in your first answer, but in the port it might.)

õζεõK can be ζεðK, õζõδK can be ζðδK.

@Grimy: Oh yeah, spaces can no longer be in the input. Thanks!

Canvas, 5 bytes
Ｈ１１╋╋

Try it here!
If overlapping /+\ → X, - + | → +, etc. would be fine, 2 bytes would work.

Python 2, 77 bytes
for t in map(None,*input()):
 r=''
 for s in t:
	if s:r=s+r[len(s):]
 print r

Try it online!

PowerShell 6, console only, 20 bytes
based on Arnauld's answer.
This work with console only and doesn't work on TIO.
cls
$args-join"`e[H"

Try it online!

PowerShell, 103 bytes
$args|%{$l=$_-split'
';$r=&{$r+($l|%{''})|%{($x=$l[$j++])+($_-replace"^.{0,$("$x"|% Le*)}")}|?{$_}}}
$r

Try it online!
Unrolled:
$args|%{
    $l=$_-split"`n"
    $r=&{                           # run this scriptblock in a new scope
        $r+($l|%{''})|%{
            $x=$l[$j++]             # a new line or $null
            $w="$x"|% Length
            $y=$_-replace"^.{0,$w}" # remove first chars from the current line
            $x+$y                   # output the new line plus tail of the overlapped line
        }|?{$_}                     # filter out not empty lines only
    }                               # close the scope and remove all variables created in the scope
}
$r

C# (.NET Core), 68 + 23 = 91 bytes
n=>{C.Clear();n.ForEach(k=>{C.SetCursorPosition(0,0);C.Write(k);});}

23 bytes is for the import, using C=System.Console;
Does not work in TIO, since it isn't a console.
Try it online!

Ruby, 67 bytes
Input is a list of lines. Builds a list of lines and does overwriting as it goes through the inputs, then joins them with a newline (represented by the variable $/) at the end to match the strict output.
->i,*r{i.map{|e|j=-1;e.map{|l|r[j+=1]||='';r[j][0,l.size]=l}};r*$/}

Try it online!

C (GCC, MinGW) 138 bytes
Assumes that CR puts the cursor at the start of the current line.
d,i,l;f(S,n,p,t)char**S,*p,*t;{for(d=i=0;i<n;d+=l)p=strchr(t=S[i],10),printf("\n%.*s\r"+!!i,l=p?p-t:strlen(t),t),S[i++]+=l+!!p;d&&f(S,n);}

Tested with:
int main()
{
    char *test1[] = {"aaaa\naaaa\naaaa\naaaa","bb\nbb\nbb","c"};
    char *test2[] = {"12345\n54321","00\n00\n00\n00","001\n011\n012"};
    char *test3[] = {"sm\noo\nmr\nee\nt!\nh_\ni_\nn_\ng_","!@#$%^\n&*()_+\nqwerty\nuiopas","this\nis_a\ntest"};

    f(test1, 3);
    f(test2, 3);
    f(test3, 3);
}

Octave, 71 67 bytes
function y=f(x)
for k=1:size(x)
y(1:(t=size(x{k})),1:t(2))=x{k};end

Function that takes a vertical cell array of char matrices, and returns a char matrix.
Try it online! Or verify all test cases.

Japt -P, 7 bytes
Takes input as an array of multi-line strings, outputs a single multi-line string.
ú y_¸¬Ì

Try it
ú y_¸¬Ì     :Implicit input of array
ú           :Right pad each line of each element with spaces to the length of the longest
  y         :Transpose
   _        :Map
    ¸       :  Split on spaces
     ¬      :  Join
      Ì     :  Last character
            :Implicitly join and output

Javascript (browser), 216 208  204 bytes
My attempt at this. I'm not happy about the size, and there must certainly be more for improvement, but I'm not that experienced at golfing.
var n='\n',x=s=>s.split``.reverse().join``,i,j,f=a=>a.map(s=>s.split(n).map(y=>x(y))).reduce((a,b)=>{for(i=0;i<b.length;i++){j=a[i];if(!j)j=b[i];a[i]=b[i].padStart(j.length,j)}return a}).map(s=>x(s)).join(n)

Anyways, what it does is first split all the strings, then reverse all the strings, then whilst looping in a reduce operation padStart all the strings together. Then reverse all the strings again and then join them back with newlines.
Special thanks to Kevin Cruijssen for reminding me that the last part in a for loop happens at the end and a total byte savings of 8 bytes.

var n='\n',x=s=>s.split``.reverse().join``,i,j,f=a=>a.map(s=>s.split(n).map(y=>x(y))).reduce((a,b)=>{for(i=0;i<b.length;a[i]=b[i++].padStart(j.length,j))if(!(j=a[i]))j=b[i];return a}).map(s=>x(s)).join(n)

console.log(f(["aaaa\naaaa\naaaa\naaaa","bb\nbb\nbb","c"]));
console.log(f(["12345\n54321","00\n00\n00\n00","001\n011\n012"]));
console.log(f(["sm\noo\nmr\nee\nt!\nh_\ni_\nn_\ng_","!@#$%^\n&*()_+\nqwerty\nuiopas","this\nis_a\ntest"]));

Both ('') can be two ` to save four bytes :)

Also, you can replace the for(i=0;i<b.length;i++){j=a[i];if(!j)j=b[i];a[i]=b[i].padStart(j.length,j)} with for(i=0;i<b.length;a[i]=b[i++].padStart(j.length,j))if(!(j=a[i]))j=b[i];.

@KevinCruijssen In your modification j doesn't get assigned. And it will fail because the if needs to happen before padStart, otherwise you get a[i](j in this case) is undefined and cannot get property length of undefined. Thanks for the four bytes saved. Didn't know you could do that.

The j is first assigned with (j=a[i]), then the if-statement is done with if(!...)j=b[i]; (where ... is the (j=a[i]), so the updated value of j), and then the ;a[i]=b[i++].padStart(j.length,j)) is done at the end of the for-loop iteration.. Not sure where the problem is, and it seems to work?

ooohhh.... * big eyes * that unlocked something

Btw, if you haven't seen them yet, tips for golfing in  and tips for golfing in JavaScript might both be interesting to read through. :)

C (gcc), 51 47 bytes
f(char**s){for(;*s;printf("\e[s%s\e[u",*s++));}

Try it online!
-4 bytes thanks to ceilingcat.
Uses the CSI sequences for save/restore cursor position. Just iterates over the passed string array (in the same format as argv) and prints <save position>string<restore position> for each.
This does leave the cursor at the top left, so when running at the terminal it is important to leave enough newlines afterwards so that the prompt doesn't clobber the input.

T-SQL query, 297 295 bytes
Using ¶ as separator and a table variable as input.
DECLARE @ table(a varchar(max),k int identity(1,1))
INSERT @ values('aaaa¶aaaa¶aaaa¶aaaa'),('bb¶bv¶bb'),('c');

WITH c as(SELECT k,row_number()over(partition
by k order by k)s,value v FROM @ CROSS APPLY
string_split(a,'¶')s),m(i,l,e)as(SELECT*FROM c
WHERE k=1UNION ALL
SELECT k,s,STUFF(e,1,len(v),v)FROM m
JOIN c ON-~i=k and s=l)SELECT
top 1with ties e FROM m
ORDER BY rank()over(partition by l order by-i)

Try it online

Javascript (browser), 129 124 bytes
My first attempt at code golfing. I read the links given in the rules (loopholes, standard rules...), so I hope I did anything wrong!

I kept the inputs as they are in the first post (flat array form).
_=o=>{o=o.map(i=>i.split`\n`),r=o.shift();for(a of o)for(l in a)b=a[l],r[l]=r[l]?b+r[l].slice(b.length):b;return r.join`\n`}

Thanks to Kevin Cruijssen for saving 5 bytes.

Tests:

_=o=>{o=o.map(i=>i.split`\n`),r=o.shift();for(a of o)for(l in a)b=a[l],r[l]=r[l]?b+r[l].slice(b.length):b;return r.join`\n`}

console.log(_(["aaaa\naaaa\naaaa\naaaa","bb\nbb\nbb","c"]));
console.log(_(["12345\n54321","00\n00\n00\n00","001\n011\n012"]));
console.log(_(["sm\noo\nmr\nee\nt!\nh_\ni_\nn_\ng_","!@#$%^\n&*()_+\nqwerty\nuiopas","this\nis_a\ntest"]));

Welcome to PPCG! Nice first answer, +1 from me. Some small things to golf: for(a of o){for(l in a){b=a[l],r[l]=(r[l])?b+r[l].slice(b.length):b}} can be for(a of o)for(l in a)b=a[l],r[l]=r[l]?b+r[l].slice(b.length):b; :)

Also, if you haven't seen it yet, tips for golfing in JavaScript and tips for golfing in  might be interesting to read through. Enjoy your stay!

@KevinCruijssen - Thanks, I updated my post! I read these two guides before posting, they were both useful. But I possibly miss some tricks that could improve even more my attempt!

One other thing from my first comment you missed are the parenthesis around the =(r[l])? which can be removed to =r[l]? :)

@KevinCruijssen - Oops, corrected!

Welcome to PPCG! Here are a few quick savings, taking input as a 2D array, to get you down to 68 bytes: https://tio.run/##jU/LboMwELznL0LbyG6oFUhyNOp/sNQY6oAjs6a226pS/p0acujjFEuzO2vNzGrP8kP61ukxPKF9VZPglhcnYtkgR6J5oZkfjQ41YE0pO1uNM12d@BR1V5XkhVwIaVJDeeFKU/FmS@Z@udQ1Zd7oVpGGGYVd6ClNHS8rutm4qbXorVHM2I4IUiYyPsD/NUmTpgG8Ig5tUlG6@u39O81JWb4/HAGPh32eRctuB/iD5SOLLFtKfkOeHwCtBRwcoFKAYQ3YC0AdgRGdiKHr57v7hxfAzSOhYgv49qlc@AJ813aUPgpCr330eBEvC8qHefH0DQ

@Shaggy - Nice, however I don't get the purpose of &&r at end?

@KévinBibollet, it's needed in order to return the final result of r. Without it, the result of the mapping would be returned instead.

If you want to retain the I/O format used in the test cases, though, you can still get down to 85 bytes but you should note that I/O is flexible.

Pyth, 18 bytes
L.tb0VyQsme #dy #N

Try it online! (note: the code itself evaluates only one block, the interpreter's test suite mode runs the program once for each line of input)
Based on TFeld's Python 2 solution.
Explanation:
L.tb0         # define a lambda function called y which does a transpose, padding with integer 0's
VyQ           # loop over transposed first input line (Q = eval(input()) ) (loop index = N)
   s          # concatenate array of strings (implicitly printed)
    m         # map over
         y #N # transpose of non-falsy values of N
     e        # for each item: last element of array
       #d     # relevant space at the start! filter with identity function, removes falsy values

for an explanation of why the algorithm itself works, see TFeld's answer.

Charcoal, 4 bytes
ＦθＰι

Try it online (verbose) or try it online (pure).
Explanation:
Loop over the input-list of multi-line strings:
For(q)
Ｆθ

And print the multi-line string without moving the cursor:
Multiprint(i);
Ｐι

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Self-displaying image
Background
There are self-extracting .ZIP files. Typically they have the extension .EXE (and by executing the file they will be extracted) but when renaming them to .ZIP, you can open the file with some ZIP extracting software.
(This is possible because .EXE files require a certain header but .ZIP files require a certain trailer so it is possible to build a file that both has an .EXE header and a .ZIP trailer.)
Your task:
Create a program that creates "self-displaying" image files:

The program shall take some 64x64 image (at least 4 colors shall be supported) as input and some "combined" file as output
The output file of the program shall be recognized as image file by common image viewers
When opening the output file with the image viewer, the input image shall be displayed
The output file shall also be recognized as executable file for any operating system or computer type
(If a file for an uncommon operating system or computer is produced, it would be nice if an open-source PC emulator exists. However, this is not required.)
When executing the output file, the input image shall also be displayed
It is probable that renaming the file (for example from .PNG to .COM) is necessary
It is not required that the program and it's output file run on the same OS; the program may for example be a Windows program and output files that can be executed on a Commodore C64.

Winning criterion

The program that produces the smallest output file wins
If the size of the output file differs depending on the input image (for example because the program compresses the image), the the largest possible output file created by the program representing a 64x64 image with up to 4 colors counts

By the way
I had the idea for the following programming puzzle when reading this question on StackOverflow.

I've added the winning condition tags (code-challenge in combination with metagolf - shortest output). As for the input 64x64 image, do you have some example images? Also, does the image itself has to be the same when viewed? Or can the output image and input image differ? To be more concrete: let's say we add some kind of code for the .exe part of the challenge, and when viewing it as a .png there are modified pixels based on this .exe-code. Is this allowed as long as it's still a .png we can view? Does the output image also have to have at least 4 colors?

How do you define "common image viewer"? For example, does an internet browser with HTML "code" count?

@KevinCruijssen When interpreted as image file, the output file shall represent the same image as the input file: Same width and height in pixels and each pixel shall have the same color. If the file formats do not support exactly the same color palette, the colors of each pixel shall be as close as possible. The same is true for the file interpreted as executable file. If the output file represents a "full screen" program, it may display the image anywhere on the screen (centered, top-left edge, ...) or stretch it to full screen size.

@JoKing "Recognized by common image viewers" means that the file format can either be read by most computers with pre-installed software (such as HTML) or that a lot of user download a free-of-cost tool to view the file (such as PDF). I would say that HTML+JavaScript can be seen as code, however, the "image viewer" should not execute the code! So it would be allowed to say a web browser is an "image viewer", but in this case HTML is not "code". Or you can say that HTML+JS is "code", but in this case the web browser is not an "image viewer".

@JoKing I would also say that something like "colored ASCII art" is allowed, so one character represents one "pixel".

Do you mean 4 colors (say black, white, two kinds of gray), or 4 channels (rgba)?

@jimmy23013 At least 4 colors means black, white and two kinds of gray. However, I would call "two kinds of gray" "grayscale" and not "colors", so black, white, red and green would be a better example.

@MartinRosenau So, is grayscale disallowed? That's a bit arbitrary. But if you want to disallowed it anyway please edit that into the question.

@jimmy23013 I would allow grayscale.

It is sad to see such an interesting question closed. As far as I understand, any concerns should be addressed before reopening a question. The main things in the comments is the "common image viewer" term, which is sufficiently hazy to be ambiguous, and the image being displayed in a state (as per @KevinCruijssen's concern) unaltered by the presence of the executable code is worthy of clarification. Would an edit addressing those concerns be enough? (I confess to not understanding the "is four colours four colours" ambiguity.)

8086 MS-DOS .COM file / BMP, output file size = 2192 bytes
Encoder
The encoder is written in C. It takes two arguments: Input file and output file. The input file is a 64x64 RAW RGB image (meaning it is simply 4096 RGB triplets). Number of colours is limited to 4, so that the palette can be as short as possible. It is very straight-forward in its doings; it merely builds a palette, packs pixels pairs into bytes and glues it together with pre-made headers and the decoder program.
#include <stdio.h>
#include <stdlib.h>

#define MAXPAL      4
#define IMAGESIZE   64 * 64

int main(int argc, char **argv)
{
    FILE *fin, *fout;
    unsigned char *imgdata = malloc(IMAGESIZE * 3), *outdata = calloc(IMAGESIZE / 2, 1);
    unsigned palette[MAXPAL] = {0};
    int pal_size = 0;

    if (!(fin = fopen(argv[1], "rb")))
    {
        fprintf(stderr, "Could not open \"%s\".\n", argv[1]);
        exit(1);
    }

    if (!(fout = fopen(argv[2], "wb")))
    {
        fprintf(stderr, "Could not open \"%s\".\n", argv[2]);
        exit(2);
    }

    fread(imgdata, 1, IMAGESIZE * 3, fin);

    for (int i = 0; i < IMAGESIZE; i++)
    {
        // BMP saves the palette in BGR order
        unsigned col = (imgdata[i * 3] << 16) | (imgdata[i * 3 + 1] << 8) | (imgdata[i * 3 + 2]), palindex;
        int is_in_pal = 0;

        for (int j = 0; j < pal_size; j++)
        {
            if (palette[j] == col)
            {
                palindex = j;
                is_in_pal = 1;
            }
        }

        if (!is_in_pal)
        {
            if (pal_size == MAXPAL)
            {
                fprintf(stderr, "Too many unique colours in input image.\n");
                exit(3);
            }

            palindex = pal_size;
            palette[pal_size++] = col;
        }

        // High nibble is left-most pixel of the pair
        outdata[i / 2] |= (palindex << !(i & 1) * 4);
    }

    char BITMAPFILEHEADER[14] = {
        0x42, 0x4D,                 // "BM" magic marker
        0x90, 0x08, 0x00, 0x00,     // FileSize
        0x00, 0x00,                 // Reserved1
        0x00, 0x00,                 // Reserved2
        0x90, 0x00, 0x00, 0x00      // ImageOffset
    };

    char BITMAPINFOHEADER[40] = {
        0x28, 0x00, 0x00, 0x00,     // StructSize
        0x40, 0x00, 0x00, 0x00,     // ImageWidth
        0x40, 0x00, 0x00, 0x00,     // ImageHeight
        0x01, 0x00,                 // Planes
        0x04, 0x00,                 // BitsPerPixel
        0x00, 0x00, 0x00, 0x00,     // CompressionType (0 = none)
        0x00, 0x00, 0x00, 0x00,     // RawImagDataSize (0 is fine for non-compressed,)
        0x00, 0x00, 0x00, 0x90,     // HorizontalRes
                                    //      db 0, 0, 0
                                    //      nop
        0xEB, 0x1A, 0x90, 0x90,     // VerticalRes
                                    //      jmp Decoder
                                    //      nop
                                    //      nop
        0x04, 0x00, 0x00, 0x00,     // NumPaletteColours
        0x00, 0x00, 0x00, 0x00,     // NumImportantColours (0 = all)
    };

    char DECODER[74] = {
        0xB8, 0x13, 0x00, 0xCD, 0x10, 0xBA, 0x00, 0xA0, 0x8E, 0xC2, 0xBA,
        0xC8, 0x03, 0x31, 0xC0, 0xEE, 0x42, 0xBE, 0x38, 0x01, 0xB1, 0x04,
        0xFD, 0x51, 0xB1, 0x03, 0xAC, 0xD0, 0xE8, 0xD0, 0xE8, 0xEE, 0xE2,
        0xF8, 0x83, 0xC6, 0x07, 0x59, 0xE2, 0xEF, 0xFC, 0xB9, 0x00, 0x08,
        0xBE, 0x90, 0x01, 0xBF, 0xC0, 0x4E, 0xAC, 0xD4, 0x10, 0x86, 0xC4,
        0xAB, 0xF7, 0xC7, 0x3F, 0x00, 0x75, 0x04, 0x81, 0xEF, 0x80, 0x01,
        0xE2, 0xEE, 0x31, 0xC0, 0xCD, 0x16, 0xCD, 0x20,
    };

    fwrite(BITMAPFILEHEADER, 1, 14, fout);
    fwrite(BITMAPINFOHEADER, 1, 40, fout);
    fwrite(palette, 4, 4, fout);
    fwrite(DECODER, 1, 74, fout);

    // BMPs are stored upside-down, because why not
    for (int i = 64; i--; )
        fwrite(outdata + i * 32, 1, 32, fout);

    fclose(fin);
    fclose(fout);
    return 0;
}

Output file
The output file is a BMP file which can be renamed .COM and run in a DOS environment. Upon execution, it will change to video mode 13h and display the image.
A BMP file has a first header BITMAPFILEHEADER, which contains among other things the field ImageOffset, which denotes where in the file the image data begins. After this comes BITMAPINFOHEADER with various de-/encoding information, followed by a palette, if one is used. ImageOffset can have a value that points beyond the end of any headers, allowing us to make a gap for the decoder to reside in. Roughly:
BITMAPFILEHEADER
BITMAPINFOHEADER
PALETTE
<gap>
IMAGE DATA

Another problem is to enter the decoder. BITMAPFILEHEADER and BITMAPINFOHEADER can be tinkered with to make sure they are legal machine code (which does not produce a non-recoverable state), but the palette is trickier. We could of course have made the palette artificially longer, and put the machine code there, but I opted to instead use the fields biXPelsPerMeter and biYPelsPerMeter, the former to make the code aligned properly, and the latter to jump into the decoder. These fields will of course then have garbage in them, but any image viewer I have tested with displays the image fine. Printing it might produce peculiar results, though.
It is, as far as I know, standard-compliant.
One could make a shorter file if the JMP instruction was put in one of the reserved fields in BITMAPFILEHEADER. This would allow us to store the image height as -64 instead of 64, which in the magical wonderland of BMP files means that the image data is stored the right way up, which in turn would allow for a simplified decoder.
Decoder
No particular tricks in the decoder. The palette is populated by the encoder, and shown here with dummy-values. It could be slightly shorter if it did not return to DOS upon a keypress, but it was not fun testing without that. If you feel you must, you can replace the last three instructions with jmp $ to save a few bytes. (Don't forget to update the file headers if you do!)
BMP stores palettes as BGR (not RGB) triplets, padded with zeroes. This makes setting up the VGA palette more annoying than usual. The fact that BMPs are stored upside-down only adds to the flavour (and size).
Listed here in NASM style:
Palette:
    db 0, 0, 0, 0
    db 0, 0, 0, 0
    db 0, 0, 0, 0
    db 0, 0, 0, 0

Decoder:
    ; Set screen mode
    mov ax, 0x13
    int 0x10

    mov dx, 0xa000
    mov es, dx

    ; Prepare to set palette
    mov dx, 0x3c8
    xor ax, ax
    out dx, al

    inc dx
    mov si, Palette + 2
    mov cl, 4
    std
pal_loop:
    push cx
    mov cl, 3
pal_inner:
    lodsb
    shr al, 1
    shr al, 1
    out dx, al
    loop pal_inner

    add si, 7
    pop cx
    loop pal_loop
    cld

    ; Copy image data to video memory
    mov cx, 64 * 64 / 2
    mov si, ImageData
    mov di, 20160
img_loop:
    lodsb
    aam 16
    xchg al, ah
    stosw
    test di, 63
    jnz skip
    sub di, 384
skip:
    loop img_loop

    ; Eat a keypress
    xor ax, ax
    int 0x16

    ; Return to DOS
    int 0x20

ImageData:

Nice. I was also thinking about the pair BMP / MS-DOS COM; I would have implemented it if there are no answers within one week. However, I would have needed much more than 10K: Because I did not assume that registers are zero-initialized, i would have placed a jump instruction at file offset 2. And because this field is interpreted as "file size" in BMP files, I would have to fill the BMP file with "dummy" bytes to ensure the "file size" field represents the correct file size.

@MartinRosenau I actually had to not assume some of the register values that I usually do (as per http://www.fysnet.net/yourhelp.htm), since the headers clobber registers, and even the first byte of the PSP, necessating int 0x20 over ret.


text:
Group Integers by Originality
Introduction:
I collect twisty puzzles. Most twisty puzzles are produced and sold by Chinese companies. Most well-known companies ask permission from puzzle designers to produce their designs and work together towards a product on the market. In this case, puzzle designers are of course very happy and proud that one of their puzzles hit the market.
There are however also Chinese companies which make knock-off puzzles. These knock-offs are either designs used without permission from the original creator, or are downright cheaper lower quality copies of already existing puzzles.
Challenge:
We're going to determine the originality of numbers that are 'released' in a specific order (from left to right†).
Given a list of integers, group and output them by their originality.
How is the originality of the numbers determined?

Is a number an exact duplicate of an earlier number? Group \$X+1\$ (least original), where group \$X+1\$ is trailing, after all the other groups.
Is a number a duplicate of an earlier number, but its negative instead (i.e. original number was \$n\$, but now \$-n\$; or vice-versa)? Group \$X\$.
Can the absolute value of the number be formed by concatenating one or more earlier absolute numbers, and is it not part of the earlier mentioned groups \$X+1\$ or \$X\$? Group \$X-N\$, where \$N\$ is the amount of distinct numbers used in the concatenation (and \$N\geq1\$).
Does the number not fit in any of the groups above, so is completely unique thus far? Group \$1\$ (most original), which is leading before all other groups.

This may sound pretty vague, so here a step-by-step example:
Input-list: [34,9,4,-34,19,-199,34,-213,94,1934499,213,3,21,-2134,44449,44]

34 is the first number, which is always original and in group \$1\$. Output thus far: [[34]]
9 is also original: [[34,9]]
4 is also original: [[34,9,4]]
-34 is the negative of the earlier number 34, so it's in group \$X\$: [[34,9,4],[-34]]
19 is original: [[34,9,4,19],[-34]]
-199 can be formed by the two earlier numbers 19 and 9, so it's in group \$X-2\$: [[34,9,4,19],[-199],[-34]]
34 is an exact copy of an earlier number, so it's in group \$X+1\$: [[34,9,4,19],[-199],[-34],[34]]
-213 is original: [[34,9,4,19,-213],[-199],[-34],[34]]
94 can be formed by the two earlier numbers 9 and 4, so it's in group \$X-2\$: [[34,9,4,19,-213],[-199,94],[-34],[34]]
1934499 can be formed by the four earlier numbers 19, 34, 4, and two times 9, so it's in group \$X-4\$: [[34,9,4,19,-213],[19499],[-199,94],[-34],[34]]
213 is the negative of the earlier number -213, so it's in group \$X\$: [[34,9,4,19,-213],[1934499],[-199,94],[-34,213],[34]]
3 is original: [[34,9,4,19,-213,3],[1934499],[-199,94],[-34,213],[34]]
21 is original: [[34,9,4,19,-213,3,21],[1934499],[-199,94],[-34,213],[34]]
-2134 can be formed by the two earlier numbers 213 and 4 (or the three earlier numbers 21, 3, and 4, but we always use the least amount of concatenating numbers to determine originality), so it's in group \$X-2\$: [[34,9,4,19,-213,3,21],[1934499],[-199,94,-2134],[-34,213],[34]]
44449 can be formed by the two earlier numbers four times 4 and 9, so it's in group \$X-2\$: [[34,9,4,19,-213,3,21],[1934499],[-199,94,-2134,44449],[-34,213],[34]]
44 can be formed by a single earlier number 4, repeated two times, so it's in group \$X-1\$:  [[34,9,4,19,-213,3,21],[1934499],[-199,94,-2134,44449],[44],[-34,213],[34]]

So for input [34,9,4,-34,19,-199,34,-213,94,1934499,213,3,21,-2134,44449,44] the output is [[34,9,4,19,-213,3,21],[1934499],[-199,94,-2134,44449],[44],[-34,213],[34]].
Challenge rules:

I/O is flexible. You can input as a list/array/stream of integers or strings, input them one by one through STDIN, etc. Output can be a map with the groups as key, a nested list as the example and test cases in this challenge, printed newline separated, etc.
You are allowed to take the input-list in reversed order (perhaps useful for stack-based languages). †In which case the mentioned left-to-right is of course right-to-left.
As you can see at the example for integer -2134, we always group a number that is a concatenation of other numbers with as few as possible (formed by 213 and 4 - two numbers; and not by 21, 3, and 4 - three numbers).
As you can see at the example for integer 1934499, you can use an earlier number (the 9 in this case) multiple times (similar with 44449 using four 4s and a 9 in the example). They are only counted once for determining the group however.
You are not allowed to have empty inner lists in the output for empty groups. So test case [1,58,85,-8,5,8585,5885,518] may not result in [[1,58,85,8,5],[518],[5885],[8585],[],[]] instead, where the empty groups are \$X\$ and \$X-1\$, and the example above may not result in [[34,9,4,19,-213,3,21],[1934499],[],[-199,94,-2134,44449],[44],[-34,213],[34]] instead, where the empty group is \$X-3\$.
The order of the groups are strict (unless you use a map, since the groups can then be deducted from the keys), but the order of the numbers within a group can be in any order. So the [34,9,4,19,-213,3,21] for group \$1\$ in the example above can also be [21,3,-213,19,4,9,34] or [-213,4,34,19,9,21,3].
You are guaranteed that there will never be any numbers that can be formed by more than nine previous numbers. So you will never have any \$X-10\$ groups, and the largest amount of groups possible is 12: \$[1,X-9,X-8,...,X-2,X-1,X,X+1]\$
You can assume the integers will be 32 bits at max, so within the range [−2147483648,2147483647].

General rules:

This is code-golf, so shortest answer in bytes wins.
Don't let code-golf languages discourage you from posting answers with non-codegolfing languages. Try to come up with an as short as possible answer for 'any' programming language.
Standard rules apply for your answer with default I/O rules, so you are allowed to use STDIN/STDOUT, functions/method with the proper parameters and return-type, full programs. Your call.
Default Loopholes are forbidden.
If possible, please add a link with a test for your code (i.e. TIO).
Also, adding an explanation for your answer is highly recommended.

Test cases:
Input:  [34,9,4,-34,19,-199,34,-213,94,1934499,213,3,21,-2134,44449,44]
Output: [[34,9,4,19,-213,3,21],[1934499],[-199,94,-2134,44449],[44],[-34,213],[34]]

Input:  [17,21,3,-317,317,2,3,117,14,-4,-232,-43,317]
Output: [[17,21,3,2,117,14,-4],[-317,-232,-43],[317],[3,317]]

Input:  [2,4,8,10,12,-12,-102,488,10824]
Output: [[2,4,8,10,12],[10824],[-102,488],[-12]]

Input:  [0,100,-100,10000,-100,1001000]
Output: [[0,100],[10000,1001000],[-100],[-100]]

Input:  [1,58,85,-8,5,8585,5885,518]
Output: [[1,58,85,-8,5],[518],[5885],[8585]]

Input:  [4,-4,44,5,54]
Output: [[4,5],[54],[44],[-4]]

So X + 1 is a special group for exact copies, and X is a group for other numbers that can be formed from copies of a single number, such as its negation?

@Neil X+1 is indeed for exact copies, X is for negative (exact) numbers, and X-1 is for numbers that can be formed from multiple copies of a single number (i.e.
444 from three earlier 4), X-2...X-9 is for numbers that can be formed by 2..9 of the previous numbers with one or multiple copies each, and group 1 is for truly unique / original numbers.

Are there any limits on how many copies of a number can constitute another? Would, for example, [4, 444444444444444] be a valid input?

@ArBo Let's assume the integers are maximum 32 bits, so in the range $[-2147483648, 2147483647]$. So your example is not a valid input, but [1, 1111111111] is possible.

If we output as a map with keys, do they still have to be in order?

@EmbodimentofIgnorance No, if they have map-key the order can be deducted from those. So if, in for example Java, you use a HashMap (simple map) instead of a TreeMap (map sorted by keys) then that's fine.

Being a collector myself: that's a damn fine collection you got there, Kevin. Very nice indeed.

@J.Sallé Thanks. :) You collect twisty puzzles as well? Or a collector in general?

I collect Magic: The Gathering cards and sets, which still occupy a suprisingly big amount of space even though they're fairly small.

@J.Sallé Oh, I know the feeling. I also collect Pokémon TCG cards (and actually have the second largest Pikachu TCG collection in the world with more than 1200 unique Pikachu cards).. When you have over 9,000 cards it indeed takes up quite a bit of space. Not as much as the puzzles, though. Only 1.5 shelves instead of 10. ;p

Jelly, 36 33 bytes
ADṪŒṖfƑƇƊQ€Ẉ.*;,AṪe$€SƲṀµƤż⁸ṢZ¹ƙ/

Try it online!
I’m sure this can be golfed more. Some inspiration taken from Grimy’s 05AB1E answer, so be sure to upvote that one too!

Python 3, 565 564 524 523 500 437 399 394 393 389 385 372 bytes
Brute-force implementation using itertools; not all test-cases run within the 60 second limit on TIO.
Try it online!
Thanks to ArBo for golfing 101 bytes, to Galen Ivanov for golfing 19 bytes, to ElPedro for golfing 5 bytes, to movatica for golfing 17 bytes, to Black Owl Kai for golfing 2 bytes, to squid for golfing 2 bytes and to Kevin Cruijssen for golfing 1 byte.
from itertools import*
w=permutations
def c(l,x):
 for i in range(9):
  for q in w(map(abs,sum(l,[]))):
   for s in w(q[:i+1]*len(x)):
    z='';s=[*s]
    while x[len(z):]:
     z+=str(s.pop(0))
     if z==x:return 9-i
 return 0
def f(a):
 l=[[]for _ in a*6]
 for x in a:l[(x in sum(l,[]))*11or(-x in sum(l,[]))*10or any(l)and c(l,str(abs(x)))]+=x,
 return[*filter(len,l)]

Explanation:
from itertools import *
w = permutations  # We'll be using this twice

def c  # Helper function to calculate which group a number belongs in according to the concatenation rule; returns 0 (original) if none is found
(l, x):  # First parameter is the list of groups (a list of lists of numbers), second parameter is the number to investigate
 for i in range(9):  # There won't be any concatenations of more than 9 elements
  for q in w(map(abs,sum(l,[]))):  # Flatten l to get a plain list of previous numbers, then generate permutations of their absolute values as lists; for each permutation ...
   for s in w(q[:i+1]*len(x)):  # ... use only the first i + 1 elements; inflate the list with enough copies to compose the target number and permutate; then try to compose the target number from each permutation:
    z = ''  # Start with the empty string
    s = [*s]  # Convert permutation to list
    while x[len(z):]:  # Keep going until the length of the concatenated string equals the length of the target number
     z += str(s.pop(0))  # Concatenate the first element of the current permutation list and remove it
     if z == x:  # If the target number has been synthesized successfully ...
      return 9 - i  # stop searching and return the appropriate group
 return 0  # If no concatenation has been found, consider the number original

def f(a):  # Solution function, takes a list of numbers as argument
 l = [[] for _ in a * 6]  # Populate the result list with at least 12 empty groups if there is more than one number in the input (we'll be using only the first 12 and removing empty ones later); if there is just one, we'll only need one group in the output
 for x in a:  # For each number in order:
  l[(x in sum(l, [])) * 11 or (-x in sum(l, [])) * 10 or any(l) and c(l, str(abs(x)))] += x,  # If x is not the first number, attempt concatenation (if not, c(l, str(abs(x))) would crash due to l not containing any non-empty sublists; use absolute value of the number under investigation; convert to string since we'll be needing the number of digits and comparing it to a string later); if -x has already been seen, put it in Group X; if x has already been seen, put it in Group X + 1
  return [* filter(len, l)]  # Remove empty lists and return the result

Python 2, 406 379 374 373 372 368 355 bytes
Same approach, but shorter due to some golfing tricks Python 3 doesn't support any more. Thanks to ArBo for the backport and for golfing 28 bytes, to ElPedro for golfing 5 bytes, to movatica for golfing 17 bytes, and to squid for golfing 1 more byte.
from itertools import*
w=permutations
def c(l,x):
 for i in range(9):
  for q in w(map(abs,sum(l,[]))):
	for s in map(list,w(q[:i+1]*len(x))):
	 z=''
	 while x[len(z):]:
		z+=`s.pop(0)`
		if z==x:return 9-i
 return 0
def f(a):
 l=[[]for _ in a*6]
 for x in a:l[(x in sum(l,[]))*11or(-x in sum(l,[]))*10or any(l)and c(l,`abs(x)`)]+=x,
 return filter(len,l)

Try it online!

Comments are not for extended discussion; this conversation has been moved to chat.

You can save 5 in both by moving str(abs(x)) (or abs(x) with backticks in Python 2) to the function call and changing x in the function definition to y removing y=str(abs(x)). Sorry, can't get TIO to work at the moment.

You can filter by len to shave off another byte, right?

You can remove the list syntax inside any() calls, thus making it a normal generator, which works just as well and saves you 4 more bytes :)

... and even shorter: (x in sum(l,[])) instead of any(x in s for s in l) for both x and -x saves 13 more bytes!

@O.O.Balance: it does work, you just mixed up the arguments for sum(): https://bit.ly/31tJc9r

@movatica Indeed, my bad. Thanks for the golf!

Sorry ... 340 bytes ;)

05AB1E, 43 41 38 35 27 bytes
.¡IN£UÄ.œεgΘ>XÄyÙå;P*}àXyå+

Try it online!
Explanation:
.¡                              # group by:
  IN£                           #  first N elements of the input, N being the iteration count
     U                          #  store this as X
  Ä                             #  absolute value of the current number
   .œ                           #  partitions (eg 449 => [[4, 4, 9], [44, 9], [4, 49], [449]])
     ε             }            #  map each partition to:
      gΘ>                       #   2 if length = 1, 1 otherwise
           yÙ                   #   for each unique element in the current partition:
         XÄ  å                  #    1 if it's in the absolute value of X, 0 otherwise
              ;                 #   divide all by 2
               P*               #   product of all these numbers
                  à             #  take the maximum
                   Xyå+         #  add 1 if X contains the current number

Since group numbers aren't part of the output, we're free to use any numbers we want, as long as the order is correct. This uses 0 for original numbers, 2^-N for group X-N, 1 for group X, 2 for group X+1.

I would love to see an explanation of how this works since I cannot read 05AB1E.

@O.O.Balance I added an explanation, hopefully it's clear enough.

Thanks, that explains it nicely. Good approach, have my upvote :)

Python 2, 235 234 232 246 245 244 241 240 238 237 236 bytes
from itertools import*
s=[];r=map(list,[s]*12)
for e in input():r[-(e in s)or max([10*(-e in s)]+[10-len(set(p[:i]))for p in permutations(`abs(x)`for x in s*11)for i in range(len(p))if''.join(p[:i])==`e`])]+=e,;s+=e,
print filter(len,r)

Try it online!
-1 byte thanks to Squid's comment on the other Python answer
This answer has no hopes of solving any but the most trivial of test cases. In the TIO link, s*11 has been replaced by s*2, sacrificing correctness in some cases for faster execution time, but as far as I can see, the version in this post always yields the correct answer, in theory.
Explanation
from itertools import*          # So that we can abuse permutations
s=[];                           # s will hold the already classified numbers
r=map(list,[s]*12)              # r will hold these too, but in the form of
                                #  a nested list, sorted by originality
for e in input():               # Here comes the big one; iterate over the input
 r[-(e in s)or                  # If e has already passed, it is not original
   max([10*(-e in s)]+          # Else, we count 10 - the number of seen elements
                                #  needed to make this one, or 0 if it's new,
                                #  or 10 if its inverse has already passed
   [10-len(set(p[:i]))          # The number of distinct elements in...
    for p in permutations(      #  for each permutation of the seen elements,
      `abs(x)`for x in s*11)
                                #  with values occuring up to 10 times (to
                                #  account for 1111111111, for example;
                                #  we need 11 here and not 10, because
                                #  p[:i] doesn't include i)...
    for i in range(len(p))      #  each prefix...
    if''.join(p[:i])            #  only if its concatenation is equal to
      ==`e`])]                  #  the current element
 +=e,;s+=e,                     # Append the element to the relevant lists
print filter(len,r)             # And finally, print the non-empty result lists

I'm pleased to see you have created your own Python answer :-) And it's shorter as well!

@O.O.Balance Now, if only it would terminate within my lifetime...

Oh, I forgot about how that's a silly thing with the Windows version (it uses only 32 bits for int even in the 64-bit version).

Python 2, 195 bytes
The slowest test case can't complete on TIO, but it only takes about 10 seconds on my machine.
import re
a=[()];m=a*99
for n in input():
    i=0;r='-('
    while i<10>re.search(r'(\b.+\b).+'*i+r+')+$','%s-%%s'%a%n):i+=1;r+='|\\'+`i`
    m[48*(n in a)|32*(-n in a)|14-i]+=n,;a+=n,
print filter(len,m)

It can be shortened by 2 bytes on LP64 Python builds by replacing '%s-%%s'%a%n with `a`+'-'+`n`.

JavaScript (Node.js), 211 205 bytes
a=>a.map(s=>(c[q=(G=(n,r=[],A=Math.abs,N=""+A(s))=>N[L="length"]<n[L]?0:N!=n?Math.max(0,...c.flat().map(x=>G(n+A(x),[...r,x]))):1/r?s-r?11:12:12+~new Set(r).size)``]=c[q]||[]).push(s),c=[])&&c.filter(x=>x)

Try it online!
Using the assumption that there are at most 12 groups.
JavaScript (Node.js), 267 226 221 218 211 bytes
a=>a.map(s=>(c[q=(G=(n,r=[],A=Math.abs,N=""+A(s))=>N[L]<n[L]?0:N!=n?Math.max(0,...c.flat().map(x=>G(n+A(x),[...r,x]))):1/r?l-(s!=+r):l+~new Set(r).size)``]=c[q]||[]).push(s),c=[],l=a[L="length"])&&c.filter(x=>x)

Try it online!
a=>a.map(                       // Iterate through all items:
 s=>(c[q=(
  G=(                           //  Helper function to calculate index (=GroupNo-1):
   n,                           //   Stores different (repeatable) permutations
   r=[],                        //   Stores the elements used
   A=Math.abs,
   N=""+A(s))                   //   Stores the string version of the absolute value
  =>
  N[L="length"]<n[L]?           //   If n is longer then N:
   0                            //    0 (Group 1) - no permutation found to equal the string
  :N!=n?                        //   Else if N!=n:
   Math.max(0,...c.flat().map(  //    Return max of the results of the next recursion
    x=>G(n+A(x),[...r,x])       //    for each of the elements in c
   ))
  :1/r?                         //   Else if r has only 1 item: (=+s/-s)
   s-r?11:12                    //    Return l-1 (Group X) if r=-s, and l (Group X+1) if r=s
  :12+~new Set(r).size          //   Else: return l-r.size-1 (Group X-r.size)
 )``]=c[q]||[]).push(s),        //  Push the element into the corresponding array
 c=[]                           //  Initialize an empty array
)&&c.filter(x=>x)               // Filter out all empty groups

... or 193 bytes if returning a dictionary is okay:

a=>a.map(c=s=>(c[q=(G=(n,r=[],A=Math.abs,N=""+A(s))=>N[L="length"]<n[L]?-1/0:N!=n?Math.max(...d.map(x=>G(n+A(x),[...r,x]))):1/r?+!(s-r):-new Set(r).size)``]=c[q]||[]).push(s)&d.push(s),d=[])&&c

Try it online!
In this case, key -Infinity means Group 1 and other keys means Group X+key.