Skip to content

hexlet-components/java-arrays-as-sets

Repository files navigation

java-arrays-as-sets

Usage

Intersection

import static io.hexlet.utils.ArraysAsSets;

String[] firstNames = {"Vasya", "Kolya", "Petya"};
String[] secondNames = {"Igor", "Petya", "Sergey", "Vasya", "Sasha"};

intersection(firstNames, secondNames);
// ["Vasya", "Petya"]

Union

import static io.hexlet.utils.ArraysAsSets;

String[] firstNames = {"Vasya", "Kolya", "Petya"};
String[] secondNames = {"Igor", "Petya", "Sergey", "Vasya", "Sasha"};

union(firstNames, secondNames);
// ["Petya", "Sasha", "Igor", "Kolya", "Vasya", "Sergey"]

Difference

import static io.hexlet.utils.ArraysAsSets;

String[] firstNames = {"Vasya", "Kolya", "Petya"};
String[] secondNames = {"Igor", "Petya", "Sergey", "Vasya", "Sasha"};
difference(firstNames, secondNames);
// ["Kolya"]

Hexlet Ltd. logo

This repository is created and maintained by the team and the community of Hexlet, an educational project. Read more about Hexlet.

See most active contributors on hexlet-friends.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •