I agree Rust does not make it easier either. This is an interesting design problem.
I tried it with ChatGPT and it did produce a robust solution. This does not seem to be a limitation for strong type hierarchy after all:
```
# Define a struct for Customer
struct Customer
id::Int
name::String
# Other customer-related fields
end
# Define a struct for Account
struct Account
id::Int
balance::Float64
type::String # e.g., "Savings", "Checking"
# Other account-related fields
end
# Define a struct to manage the many-to-many relationship
struct CustomerAccount
customer::Customer
account::Account
end
# Define a struct for the Bank which holds all information
struct Bank
customers::Dict{Int, Customer}
accounts::Dict{Int, Account}
customerAccounts::Vector{CustomerAccount}
end
```