public int[] twoSum(int[] numbers, int target) {
        int[] numbers2 = Arrays.copyOf(numbers, numbers.length);
        Arrays.sort(numbers2);
        int start = 0;
        int end = numbers2.length - 1;

        while (start < end) {
            int sum = numbers2[start] + numbers2[end];
            if (sum == target) {
                break;
            } else if (sum < target) {
                start++;
            } else {
                end--;
            }
        }

        int index1 = -1, index2 = -1;
        for (int i = 0; i < numbers.length; i++) {
            if (numbers[i] == numbers2[start] && index1 == -1) {
                index1 = i + 1;
            } else if (numbers[i] == numbers2[end]) {
                index2 = i + 1;
            }
        }
        int[] indexes = new int[2];
        indexes[1] = Math.max(index1, index2);
        indexes[0] = Math.min(index1, index2);
        return indexes;
    }