2 added 234 characters in body
source | link

I came up with this and then noticed it is a variation on Anon's approach:

 # /. {___, x:Longest[False ...], __, y:Longest[False ...]} :> {Length[{x}], Length[{y}]} &

The same idea, with a named function:

f[list_] := Length[list /. {___, x : Longest[False ...], __} :> {x}]

Example:

 {f[t], f[Reverse[t]]}

{3, 2}

I came up with this and then noticed it is a variation on Anon's approach:

 # /. {___, x:Longest[False ...], __, y:Longest[False ...]} :> {Length[{x}], Length[{y}]} &

I came up with this and then noticed it is a variation on Anon's approach:

 # /. {___, x:Longest[False ...], __, y:Longest[False ...]} :> {Length[{x}], Length[{y}]} &

The same idea, with a named function:

f[list_] := Length[list /. {___, x : Longest[False ...], __} :> {x}]

Example:

 {f[t], f[Reverse[t]]}

{3, 2}

1
source | link

I came up with this and then noticed it is a variation on Anon's approach:

 # /. {___, x:Longest[False ...], __, y:Longest[False ...]} :> {Length[{x}], Length[{y}]} &