len-uniq-tuple-leads.xgo 274 B

1234567891011121314151617
  1. os := import("os")
  2. fmt := import("fmt")
  3. json := import("json")
  4. args := os.args()[2:]
  5. file_path := args[0]
  6. arr := json.decode(os.read_file(file_path))
  7. ret := {}
  8. for _, v in arr {
  9. if !v.lead || !v.lead.id{
  10. continue
  11. }
  12. ret[string(v.lead.id)] = 1
  13. }
  14. fmt.println(len(ret))