I use the algpseudocode package to write algorithms, and the hyperref package to add hyperlinks to footnotes. I want to be be able to add footnotes with hyperlinks within my algorithms.
Something like this would be nice:
\documentclass[12pt]{article}
\usepackage{algorithm}
\usepackage{algpseudocode}
\usepackage{hyperref}
\begin{document}
\begin{algorithm}[H]\caption{Do something}
\label{alg: CR}
On input, do:
\begin{enumerate}
\item Do something. \footnote{Footnote one}
\item Do a second thing.
\item Aha! The final thing. \footnote{Footnote two}
\item Oops, do one more. \footnote{Footnote three}
\end{enumerate}
\end{algorithm}
Text\footnote{Footnote four}
\end{document}
Unfortunately, this doesn't work; only footnote four is displayed:

I believe this has something to do with the algorithm environment being a float, similar to figures or tables. As such, I hoped that solutions to "Footnote in table" type questions would help, but I haven't had much luck. Wrapping the algorithm environment in a savenotes environment worked insofar as all of the footnotes get displayed, but only the hyperlinks for footnote three and footnote four work (the other two just take you to the start of the document). Similar results can be achieved using tablefootnotes and manually adding footnotetext.
Any suggestions would be gratefully received!

savenotesincorrectly. I managed the resolve the issue; solution documented below.