Java Straightforward Solution
Code\njava []\nclass Solution {\n  public int getKthElement(int n) {\n    int res = -1;\n    for (int i = 0; i <= 1000; i++)\n      if ((i | (i + 1)) == n)\n   
# Code\n```java []\nclass Solution {\n  public int getKthElement(int n) {\n    int res = -1;\n    for (int i = 0; i <= 1000; i++)\n      if ((i | (i + 1)) == n)\n        return i;\n    return res;\n  }\n\n  public int[] minBitwiseArray(List<Integer> nums) {\n    return IntStream.range(0, nums.size())\n      .map(it -> getKthElement(nums.get(it)))\n      .toArray();\n  }\n}\n```
['Java']