Wrap-Around Subsequences Introduction

In this challenge, your task is to find generalized subsequences of strings.
The subsequences are not necessarily contiguous, and they can also "wrap around" the string, going past its end and starting again from the beginning.
You'll want to minimize the number of wraps, though.

More formally, let u and v be any two strings, and k &ge; 0 an integer.
We say that u is a k-wrapping subsequence of v, if there are distinct indices i1, i2, ..., ilen(u) such that u == v[i1] v[i2] ... v[ilen(u)], and at most k of the indices ij satisfy ij &gt; ij+1.
This means that u can be found inside v by going from left to right, choosing some of its characters on the way, and wrapping around at most k times (equivalently, doing at most k+1 sweeps across v).
Note that no character can be chosen more than once, even after a wrap-around, and that 0-wrapping subsequences are exactly the ordinary subsequences that we are all familiar with.

The Task

Your inputs are two non-empty alphanumeric strings u and v, and your output is the smallest integer k such that u is a k-wrapping subsequence of v.
If no such k exists, the output shall be -1.

Example

Consider the inputs u := xyzyxzzxyx and v := yxzzazzyxxxyz.
If we start looking for the characters of u in v in a greedy fashion, we will wrap around 3 times:

 yxzzazzyxxxyz
&gt;─x─────y────z┐
┌─────────────┘
└y───────x────┐
┌─────────────┘
└──zz─────x─y─┐
┌─────────────┘
└──────────x──&gt;


Thus the correct output is at most 3.
Note how the left-most character x is selected once, and then ignored on the second sweep, since it cannot be re-used.
However, there exists a shorter method with only 2 wrap-arounds:

 yxzzazzyxxxyz
&gt;──────────xyz┐
┌─────────────┘
└yxzz────x────┐
┌─────────────┘
└───────y─x───&gt;


It turns out that one wrap-around (that is, two sweeps) is not enough, so the correct output is 2.

Rules and Bonuses

You can write either a function or a full program, and you can also change the order of the inputs if needed.
The lowest byte count wins, and standard loopholes are disallowed.

There is a bonus of -10% for computing all of the test cases in under 10 seconds total. I will test unclear cases on my machine; my reference implementation in Python takes about 0.6 seconds. I have a 7-year old laptop with 1.86 GHz dual core CPU, which you may want to take into account.

Test Cases

"me" "moe" -&gt; 0
"meet" "metro" -&gt; -1
"ababa" "abaab" -&gt; 1
"abaab" "baabaa" -&gt; 1
"1c1C1C2B" "1111CCCcB2" -&gt; 3
"reverse" "reserved" -&gt; 2
"abcdefg" "gfedcba" -&gt; 6
"xyzyxzzxyx" "yxzzazzyxxxyz" -&gt; 2
"aasdffdaasdf" "asdfddasdfsdaafsds" -&gt; 2
Pyth, 34 bytes

Mh+Smssm&gt;.ukC,dtdfqGsm@HkT.PUHlG_1


This defines a function g, which takes two strings as parameter. Try it online: Pyth Compiler/Executor

This code is very inefficient. It has a time and memory complexity of len(v)!/(len(v)-len(u))!. It is not able to solve the longer test cases in under 10 seconds. (It also will crash very likely, since it will run out of memory.)

M                                    define g(G, H): return _
                          .PUHlG        all permutations of [0, 1, ..., len(H)-1] of length len(G)
                 fqGsm@HkT              filter the permutations which form the string G
    mssm&gt;.ukC,dtd                       compute the number of wraps for each of the remaining permutations
  +S                            _1      sort the numbers and append -1
 h                                      return the first element