It is not hard to shuffle an array in O(n), with in place swapping,

How to do it for list in OCaml, with O(n)?


Requirement:

  1. No array or in place usage

  2. Consider this as an interview question

Edit
Report