Update appNew update is available. Click here to update.
About
Vellore Institute of Technology 2025
My Stats
EXP gained
yellow-spark
5778
Level
6 (Specialist)
Community stats
Discussions
0
Upvotes
0
Know more
101
Total problems solved
75
Easy
24
Moderate
2
Hard
0
Ninja
Dec Dec Jan Jan Feb Feb Mar Mar Apr Apr May May Jun Jun Jul Jul Aug Aug Sep Sep Oct Oct Nov Nov

Current streak:

0 days

Longest streak:

14 days

Less

More

Achievements
1
Ronin
Topics
Arrays
1
Samurai
Topics
Linked List
Discussions
Best solution in cpp O(N) , O(1) using two pointer
Interview problems
        sort(nums.begin() , nums.end());
        int i=0;
        int j= nums.size()-1;

        while(i!=j){
            int sum = nums[i] + nums[j];
            if(sum==target){
                return "YES";
                // break;
            }
            else{

                sum < target ? i++ : j--;
            }
        }
        return "NO";
profile
yaswanth_Mitta
Published On 19-Aug-2023
38 views
0 replies
0 upvotes
error while submission
Interview problems

Though the code is correct and test cases are passing while submitting the code it shows error . Is it happening with everyone?

My code:

 

void bubbleSort(int arr[], int n) 
{
    //write your code here
    if(n==0) return;
    
    for(int i=0;i<n-1; i++){
        if(arr[i] > arr[i+1]){
            swap(arr[i] , arr[i+1]);
        }
    }
    
    bubbleSort(arr , n-1);
}
profile
yaswanth_Mitta
Published On 08-Aug-2023
115 views
2 replies
10 upvotes
partiaally correct?
Interview problems

int sumFirstN(int n) {

    // Write Your Code Here

    

    if(n==1){

        return 1;

    }

    return n + sumFirstN(n-1);

    

}

 

just wanted to know why its partially correct? 

 

profile
yaswanth_Mitta
Published On 07-Aug-2023
160 views
3 replies
0 upvotes