I'm walking around manhattan, how far am I from my hotel? The unnecessary and convoluted story

I am walking around manhattan, block by block and my feet have gotten tired and want to go back home.

The traffic is pretty bad, but fortunately I'm very rich and I have a helicopter on standby at the hotel. But I need them to know how much fuel to pack for the flight and for that they need to know my direct distance from the hotel. I did remember which blocks I walked and can tell them what route I took. This distance needs to be precise though, if they are too short we won't make it back, too long and I've bought fuel I can't use.

Can you write me a program to convert that into the distance they will have to travel on their flight to fetch me?

Specification:

Write me a function that:


Accepts a list or string of blocks walked relative to an arbitrary grid:


U p, D own, L eft and R ight.
Can be either upper or lower case - eg. if its shorter to use u instead of U go ahead.
An invalid direction has undefined behaviour - eg. a direction of X can cause a failure.

Returns a float/decimal/double that is twice the straight line distance from the point of origin.


For illustration and clarification:



My trip could have just as easily been recorded as "luluu..." or ['l','u','l'...] but it must be recorded as Up, Down, Left, Right.
J, 17 characters
2*|+/0j1^'urdl'i.

Uses the fact, that the powers of j represent the proper directions.

'urdl'i. take string and calculate indices (0 for 'u', 1 for 'r', ...)
0j1^ transforms into the direction in the complex plane using the corresponding power of j.
+/ sums up the single steps
2*| two times the modulus

Example:
&gt; 2*|+/0j1^'urdl'i.'uuuudrrrl'
7.2111