Verify there is a combination of unique string

前端 未结 4 1973
忘了有多久
忘了有多久 2021-01-21 12:17
class Details{
 String name;
 String age;
 String email;
 String location;
}

1) If there is List of Details as in List

how
4条回答
  •  梦谈多话
    2021-01-21 12:41

    You can hash values by a separator like #, and then find that all uniques or not. Hash value for a Details is name + "#" + "email in the first case, and is name + "#" + age + "#" + email + "#" + location in the second case. You can using Hashmap to find duplicates if there is any with the specified key (or hash) for each instance of Details.

提交回复
热议问题