code translation Java: public class Solution { public static boolean hasCloseElements(int[] nums, int threshold) { for (int i = 0; i < nums.length - 1; i++) { for (int j = i + 1; j < nums.length; j++) { if (Math.abs(nums[i] - nums[j]) < threshold) { return true; } } } return false; } } Python: