Update appNew update is available. Click here to update.
About
My Stats
EXP gained
yellow-spark
1319
Level
5 (Champion)
Community stats
Discussions
0
Upvotes
2
Know more
23
Total problems solved
19
Easy
4
Moderate
0
Hard
0
Ninja
Jan Jan Feb Feb Mar Mar Apr Apr May May Jun Jun Jul Jul Aug Aug Sep Sep Oct Oct Nov Nov Dec Dec

Current streak:

0 days

Longest streak:

3 days

Less

More

Discussions
Simple and optimised C++ solution
Interview problems
vector<int> reverseArray(int n, vector<int> &nums)
{
    // Write your code here.
    int start = 0;
    int end = n-1;

    while(start<end){
        int temp = nums[start];
        nums[start] = nums[end];
        nums[end] = temp;

        start++;
        end--;
    }

    return nums;

}
profile
ARNAV SHUKLA (RA2111050010001)
Published On 24-Oct-2023
187 views
1 replies
0 upvotes
Most simple solution c++
Interview problems

long long sumFirstN(long long n) {
    // Write your code here.
    if(n==0){
      return 0;  
    } 
    

    return n + sumFirstN(n-1);
}
profile
ARNAV SHUKLA (RA2111050010001)
Published On 24-Oct-2023
275 views
0 replies
1 upvotes