package com.loveCoding.homework.j20250517;

import java.util.Arrays;
import java.util.HashSet;

/**
 * @author WanJl
 * @version 1.0
 * @title T11
 * @description
 * **11. 数组去重**
 * 要求：创建新数组，保留原数组元素的首次出现顺序
 * 示例输入：`{2,5,2,3,5,8}`
 * 示例输出：`2,5,3,8`
 * @create 2025/5/24
 */
public class T11 {
    public static void main(String[] args) {
        int[] arr={2,5,2,3,5,8};

        HashSet s=new HashSet();
        for (int i = 0; i < arr.length; i++) {
            s.add(arr[i]);
        }
        System.out.println(s.toString());

    }
}
