Update appNew update is available. Click here to update.
About
Bhagwan Parshuram Institute of Technology 2024
My Stats
EXP gained
yellow-spark
5061
Level
6 (Specialist)
Community stats
Discussions
0
Upvotes
0
Know more
141
Total problems solved
102
Easy
39
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:

1 day

Longest streak:

6 days

Less

More

Achievements
2
Samurai
Topics
Hash Table
Arrays
Discussions
Easy C++ code
Interview problems

int removeDuplicates(vector<int> &arr, int n) {

    // Write your code here.

    int i=0,index=1;

    for(int j=1;j<n;j++){

        if(arr[j]!=arr[j-1]){

            index+=i+1;

        }

    }

    return index;

}

profile
Harshit_5451
Published On 12-Oct-2023
126 views
0 replies
0 upvotes