From 5b3dd60fe919fbe3fbf78f013cb669f4f373f6b5 Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Wed, 15 Jan 2025 13:49:57 +0100 Subject: [PATCH] satellite: fix parameter order (#1305) --- exercises/practice/satellite/.meta/Example.fs | 4 ++-- exercises/practice/satellite/Satellite.fs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/exercises/practice/satellite/.meta/Example.fs b/exercises/practice/satellite/.meta/Example.fs index 27cd3a815..e2e9a43c5 100644 --- a/exercises/practice/satellite/.meta/Example.fs +++ b/exercises/practice/satellite/.meta/Example.fs @@ -13,7 +13,7 @@ let rec createTree inorder preorder = let leftPreorder, rightPreorder = tail[0 .. leftInorder.Length - 1], tail[leftInorder.Length ..] Node(hd, createTree leftInorder leftPreorder, createTree rightInorder rightPreorder) -let treeFromTraversals preorder inorder = +let treeFromTraversals inorder preorder = if List.length preorder <> List.length inorder then Error "traversals must have the same length" elif List.sort preorder <> List.sort inorder then @@ -21,4 +21,4 @@ let treeFromTraversals preorder inorder = elif List.distinct preorder <> preorder then Error "traversals must contain unique items" else - Ok(createTree preorder inorder) + Ok(createTree inorder preorder) diff --git a/exercises/practice/satellite/Satellite.fs b/exercises/practice/satellite/Satellite.fs index ebfbf1ad6..e7cc24431 100644 --- a/exercises/practice/satellite/Satellite.fs +++ b/exercises/practice/satellite/Satellite.fs @@ -4,5 +4,5 @@ type Tree = | Empty | Node of value: string * left: Tree * right: Tree -let treeFromTraversals preorder inorder = +let treeFromTraversals inorder preorder = failwith "Please implement the 'treeFromTraversals' function"