LeetCode 1791. Find Center of Star Graph in F#

URL

https://leetcode.com/problems/find-center-of-star-graph/description/?envType=daily-question&envId=2024-06-27

Code

https://github.com/syohex/dotnet-study/blob/master/fsharp/leetcode/challenge/202406/find_center_of_star_graph/main.fsx

let findCenter (edge: (int * int) list) : int =
    match edge with
    | []
    | _ :: [] -> failwith "never reach here"
    | (s1, e1) :: (s2, e2) :: _ -> if s1 = s2 || s1 = e2 then s1 else e1