Haskell, (削除) 71 64 (削除ここまで) 6451 bytes
g#l=[[x|x<-[1..length g]],c<-w,elem x[sum[1|e<x==sum[1|e<-g,e==c]]]e==c]]!!0|w<-l]
- Massively outgolfed by @pxeger answer, check it out .
Full list comprehension solution
- saved 13 Bytes thanks to @Unrelated String
Old 71 bytes
g#w=sum.f<$>((\y->[1|l<-g,l==y])<$>)<$>w
f(h:t)|h<f t=h|1>0=f t
f[]=[2]
g#w takes g grid as a string with newlines and w words as a list of words.
Each word is transformed into a list of lists of 1's by g before using f to select the shortest(lexicographically) character.
f has an edge case = [2] for the end of the list which is always greater.
Then sum each selection to obtain the output
Haskell, (削除) 71 (削除ここまで) 64 bytes
g#l=[[x|x<-[1..length g],c<-w,elem x[sum[1|e<-g,e==c]]]!!0|w<-l]
Full list comprehension solution
Old 71 bytes
g#w=sum.f<$>((\y->[1|l<-g,l==y])<$>)<$>w
f(h:t)|h<f t=h|1>0=f t
f[]=[2]
g#w takes g grid as a string with newlines and w words as a list of words.
Each word is transformed into a list of lists of 1's by g before using f to select the shortest(lexicographically) character.
f has an edge case = [2] for the end of the list which is always greater.
Then sum each selection to obtain the output
Haskell, (削除) 71 64 (削除ここまで) 51 bytes
g#l=[[x|x<-[1..],c<-w,x==sum[1|e<-g,e==c]]!!0|w<-l]
- Massively outgolfed by @pxeger answer, check it out .
Full list comprehension solution
- saved 13 Bytes thanks to @Unrelated String
Old 71 bytes
g#w=sum.f<$>((\y->[1|l<-g,l==y])<$>)<$>w
f(h:t)|h<f t=h|1>0=f t
f[]=[2]
g#w takes g grid as a string with newlines and w words as a list of words.
Each word is transformed into a list of lists of 1's by g before using f to select the shortest(lexicographically) character.
f has an edge case = [2] for the end of the list which is always greater.
Then sum each selection to obtain the output
Haskell, 71(削除) 71 (削除ここまで) 64 bytes
g#l=[[x|x<-[1..length g],c<-w,elem x[sum[1|e<-g,e==c]]]!!0|w<-l]
Full list comprehension solution
Old 71 bytes
g#w=sum.f<$>((\y->[1|l<-g,l==y])<$>)<$>w
f(h:t)|h<f t=h|1>0=f t
f[]=[2]
g#w takes g grid as a string with newlines and w words as a list of words.
Each word is transformed into a list of lists of 1's by g before using f to select the shortest(lexicographically) character.
f has an edge case = [2] for the end of the list which is always greater.
Then sum each selection to obtain the output
Haskell, 71 bytes
g#w=sum.f<$>((\y->[1|l<-g,l==y])<$>)<$>w
f(h:t)|h<f t=h|1>0=f t
f[]=[2]
g#w takes g grid as a string with newlines and w words as a list of words.
Each word is transformed into a list of lists of 1's by g before using f to select the shortest(lexicographically) character.
f has an edge case = [2] for the end of the list which is always greater.
Then sum each selection to obtain the output
Haskell, (削除) 71 (削除ここまで) 64 bytes
g#l=[[x|x<-[1..length g],c<-w,elem x[sum[1|e<-g,e==c]]]!!0|w<-l]
Full list comprehension solution
Old 71 bytes
g#w=sum.f<$>((\y->[1|l<-g,l==y])<$>)<$>w
f(h:t)|h<f t=h|1>0=f t
f[]=[2]
g#w takes g grid as a string with newlines and w words as a list of words.
Each word is transformed into a list of lists of 1's by g before using f to select the shortest(lexicographically) character.
f has an edge case = [2] for the end of the list which is always greater.
Then sum each selection to obtain the output
Haskell, 71 bytes
g#w=sum.f<$>((\y->[1|l<-g,l==y])<$>)<$>w
f(h:t)|h<f t=h|1>0=f t
f[]=[2]
g#w takes g grid as a string with newlines and w words as a list of words.
Each word is transformed into a list of lists of 1's by g before using f to select the shortest(lexicographically) character.
f has an edge case = [2] for the end of the list which is always greater.
Then sum each selection to obtain the output