Last active
September 17, 2025 08:06
-
-
Save Amberlamps/adcf28393104d1ecf5b5b5536c7b43c6 to your computer and use it in GitHub Desktop.
exercise.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import "fmt" | |
| type Claim struct { | |
| ID string | |
| Amount int | |
| } | |
| type Insurer struct { | |
| ID string | |
| Balance int | |
| } | |
| type PayoutTransaction struct { | |
| ClaimID string | |
| InsurerID string | |
| Amount int | |
| } | |
| func main() { | |
| claims := []Claim{ | |
| {ID: "a", Amount: 100}, | |
| {ID: "b", Amount: 50}, | |
| {ID: "c", Amount: 40}, | |
| {ID: "d", Amount: 60}, | |
| {ID: "e", Amount: 20}, | |
| {ID: "f", Amount: 90}, | |
| {ID: "g", Amount: 120}, | |
| {ID: "h", Amount: 30}, | |
| } | |
| insurers := []Insurer{ | |
| {ID: "A", Balance: 250}, | |
| {ID: "B", Balance: 250}, | |
| {ID: "C", Balance: 100}, | |
| } | |
| // Example usage | |
| fmt.Printf("Claims: %+v\n", claims) | |
| fmt.Printf("Insurers: %+v\n", insurers) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment