Given a source path and a destination path, output the relative path to the destination with respect to the source.
The input can come from stdin or as arguments to the program/function.
Both Windows and Unix style paths must be supported.
The output path can use
\for the path separator (your choice and combination of both is OK).
You can assume a relative path is possible.
The use of external programs, built-in or library functions made for computing relative paths is prohibited (e.g. Python's
This is code-golf
Edit: New rule from comments.
The relative path must be the shortest relative path possible.
Assume the destination path is different from the source path.
# In /usr/share/geany/colorschemes /usr/share/vim/vim73/ftplugin # Out ../../vim/vim73/ftplugin
# In C:\Windows\System32\drivers C:\Windows\System32\WindowsPowerShell\v1.0 # Out ..\WindowsPowerShell\v1.0