InterviewBit - Prime Sum  

by ne on 2021-09-22 under Algo

This problem is a property of InterviewBit (

Full details of the question, and if you want to try it out yourself, proceed to interviewbit :

Here's the implementation:


public class Solution {
    public int[] primesum(int A) {
        for(int i=2;i<1+A/2;i++){
                    return new int[]{i,A-i};
        return new int[]{};
    private boolean isPrime(int n){
        int sqrm=1+(int)Math.sqrt(n);
        for(int i=2;i<sqrm;i++){
                return false;
        return true;

Happy Coding !