JAVA - Codility PermCheck test 100% score

Solution to Codility PermCheck Problem at:

https://codility.com/c/intro/demoJH2RM2-UZ8

class Solution {
    public static void main(String[] args) {
 int A[] = {4, 1, 3, 2};
 //int A[] = {4, 4, 3, 2};
 //int A[] = {4, 3, 2};
 //int A[] = {};
 //int A[] = {1000000000, 3, 2};
 //int A[] = {1000000000, 1000000001, 1000000002};
 //int A[] = new int[100000];
 System.out.println(solution(A));  
    }

    public static int solution(int[] A) {
     int result = 0;
     int size = A.length;
     int[] B = new int[A.length];
     if(size == 0)
      return 0;
     for(int i=0; i<A.length; i++){
      if(A[i]>size)
       return result;
      if(A[i]<1)
       return result;
      if(B[A[i]-1] == -1)
       return result;
      else 
       B[A[i]-1] = -1;
     }
     return 1;
    }
}

JAVA - Codility FrogRiverOne test 100% score

class Solution {
        public int solution(int X, int[] A) {
            // write your code in Java SE 8
            int numberOfPositions = 0;
            int result = -1;
            int[] array = new int[X];
            int index = 0;

            // Initialize array
            for (int i : array) {
                array[index] = -1;
                index++;
            }

            index = 0;
            for (int i : A) {
                try {
                    if (array[i - 1] == -1) {
                        array[i - 1] = index;
                        numberOfPositions++;
                        if (index > result)
                            result = index;
                        if (X == numberOfPositions) {
                            break;
                        }
                        index++;
                    } else {
                        index++;
                        continue;
                    }
                } catch (Exception e) {
                    index++;
                    continue;
                }
            }
            if (X == numberOfPositions)
                // System.out.println(result);
                return result;
            else
                // System.out.println("-1");
                return -1;
        }
    }

JAVA - Codility Equilibrium test 100% score

My solution:

class Solution { 
    public int solution(int[] B) {
  
        // write your code in Java SE 8
        long[] rightToLeft = new long[A.length];
        long[] leftToRight = new long[A.length];
        long[] A = new long[B.length];
        int result = -1;
     
        // Convert int array to long array
        int j = 0;
        for (int value : B) {
            A[j++] = (long)value; 
        }
        
        for(int i=0; i<rightToLeft.length; i++){
            if(i==0){
             rightToLeft[i] = A[i];
            } else {
             rightToLeft[i] = A[i] + rightToLeft[i-1];
            }
        }

        for(int i=leftToRight.length-1; i>=0; i--){
            if(i==leftToRight.length-1){
                leftToRight[i] = A[i];
            } else {
                leftToRight[i] = A[i] + leftToRight[i+1];
            }
        }
        
        for(int i=0; i<rightToLeft.length; i++){
            if(rightToLeft[i] == leftToRight[i]) {
                result = i;
                break;
            }
        }
        return result;
    }
}

APEX - Error saving column settings with ORA-01403: no data found Error


Problem:

While working with the report source and column names somehow it became "corrupted", it was impossible to change the name of one of the columns though possible to update the source and the rest of column names:

While saving the report APEX was showing the bellow error:

   Error saving column settings with ORA-01403: no data found Error

Solution:

Try to force APEX to refresh the column names by selection:

(this action will erase all existing column names)

   Use Generic Column Names (parse query at runtime only)