Kth Smallest Product of Two Sorted Arrays  .....problem in ide
\nimport java.io.;\nimport java.util.;\n\npublic class striver {\n\n\n\n\tpublic static void main(String[] args) {\n\t\ttry {\n\t\t\tSystem.setIn(new FileInputS
\nimport java.io.*;\nimport java.util.*;\n\npublic class striver {\n\n\n\n\tpublic static void main(String[] args) {\n\t\ttry {\n\t\t\tSystem.setIn(new FileInputStream("input.txt"));\n\t\t\tSystem.setOut(new PrintStream(new FileOutputStream("output.txt")));\n\t\t} catch (Exception e) {\n\t\t\tSystem.err.println("Error");\n\t\t}\n\n\t\t//code here\n\t\t//int []arr1 = new int[2];\n\t\t//int []arr2 = new int[1];\n\n\t\tint [] nums1 = { 4, -2, 0, 3};\n\t\tint [] nums2 = { 2, 4};\n\t\tlong k = 6;\n\n\n\n\t\tList <Integer> list = new ArrayList<>();\n\n\t\tList <Integer> ans = new ArrayList<>();\n\n\t\tfor (int i : nums1) {\n\t\t\tlist.add(i);\n\n\t\t}\n\n\t\tfor (int i : nums2) {\n\t\t\tlist.add(i);\n\t\t}\n\n\n\t\tfor (int i = 0; i < list.size(); i++) {\n\n\t\t\tfor (int j = i + 1; j < list.size(); j++) {\n\n\t\t\t\tint pr = list.get(i) * list.get(j);\n\n\t\t\t\tans.add(pr);\n\t\t\t}\n\t\t}\n\n\t\tCollections.sort(ans);\n\t\tLong dere = new Long(k);\n\t\tint kk = dere.intValue();\n\t\tint a = ans.get(kk - 1);\n\t\tlong Ans = a;\n\t\tSystem.out.println(Ans);\n\t\tSystem.out.println(ans);\n\n\t}\n}![image](https://assets.leetcode.com/users/images/d49ae0f9-2a4b-4d78-9423-32e7425d4e04_1639743311.3091905.png)\n\n![image](https://assets.leetcode.com/users/images/7198178d-7931-4b44-9c51-9a8bb694d255_1639743458.7382004.png)\n\n
[]