Hello, I'm Suvam , and I'm passionate about crafting immersive web experiences and solving challenging coding problems. As a Frontend Web Developer with a keen interest in Competitive Coding, I strive...
Chandigarh University 2025
C++ - Default language
My Stats
EXP gained
31769
Level
7 (Expert)
Community stats
Discussions
0
2
Know more
Weekend contest rating
Contest attended
Problems solved
2021 2023
Better than %
Weekend contest rating
Contest attended
Problems solved
2021 2023
Better than %
957
Total problems solved
921
Easy
30
Moderate
6
Hard
0
Ninja

Current streak:

0 days

Longest streak:

37 days

Less

More

Achievements
3
Ronin
Topics
Greedy
Strings
Arrays
8
Sensei
Guided path
Oops in python
+ 7 more
Discussions
C++ Solution using two pointer approach : A start pointer and an end pointer
Interview problems

bool isPalindrome(string& str) {    // Write your code here.    int start=0;       int end=str.size()-1;       while(start<=end){           if(!isalnum(str[start])){start++; continue;}           if(!isalnum(str[end])){end--;continue;}           if(tolower(str[start])!=tolower(str[end]))return false;           else{               start++;               end--;           }       }       return true;

}

thedaudgy
Published On 11-Aug-2023
93 views
0 replies
C++ Solution using two pointer approach : A start pointer and an end pointer
Interview problems

bool isPalindrome(string& str) {    // Write your code here.    int start=0;       int end=str.size()-1;       while(start<=end){           if(!isalnum(str[start])){start++; continue;}           if(!isalnum(str[end])){end--;continue;}           if(tolower(str[start])!=tolower(str[end]))return false;           else{               start++;               end--;           }       }       return true;

}

thedaudgy
Published On 11-Aug-2023
93 views
0 replies
C++ Solution with all test cases passed
Interview problems

#include <bits/stdc++.h>

#include <algorithm>

using namespace std;

int sumOfMaxMin(int arr[], int n) {

int maxi = *max_element(arr, arr + n);

int mini = *min_element(arr, arr + n);

return maxi + mini;

}

thedaudgy
Published On 09-Aug-2023
103 views
0 replies
C++ Solution with all passed test Cases
Interview problems

#include<bits/stdc++.h>

vector<int> kthSmallLarge(vector<int> &arr, int n, int k)

{

sort(arr.begin(), arr.end());

int i=0;

int cnt=0;

vector<int>ans;

while(i<arr.size()){

cnt++;

if(k==cnt){

ans.push_back(arr[i]);

break;

}

i++;

}

i=arr.size()-1;

cnt=0;

while(i>=0){

cnt++;

if(k==cnt){

ans.push_back(arr[i]);

break;

}

i--;

}

return ans;

}

thedaudgy
Published On 07-Aug-2023
187 views
0 replies
C++ Solution with all passed test cases
Interview problems
``````#include <bits/stdc++.h>
void sort012(int *arr, int n)
{
int i=0;
int j=n-1;
int c = 0;
while(c<=j)
{
while(c<=j && arr[c] == 0)
{
swap(arr[c],arr[i]);
c++;
i++;
}
while(c<=j && arr[c] == 2)
{
swap(arr[c],arr[j]);
j--;
}
while(c<=j && arr[c] == 1)
{
c++;
}
// c++;
}
return ;
}``````
thedaudgy
Published On 07-Aug-2023
192 views
0 replies
C++ Solution with all passed test cases
Interview problems
``````#include <bits/stdc++.h>
void sort012(int *arr, int n)
{
int i=0;
int j=n-1;
int c = 0;
while(c<=j)
{
while(c<=j && arr[c] == 0)
{
swap(arr[c],arr[i]);
c++;
i++;
}
while(c<=j && arr[c] == 2)
{
swap(arr[c],arr[j]);
j--;
}
while(c<=j && arr[c] == 1)
{
c++;
}
// c++;
}
return ;
}``````
thedaudgy
Published On 07-Aug-2023
192 views
0 replies
C++ Solution with all passed test cases
Interview problems

#include <bits/stdc++.h>

void reverseArray(vector<int> &arr , int m)

{

// Write your code here.

vector<int>vec;

for(int i=m+1;i<arr.size();i++)

{

vec.push_back(arr[i]);

}

reverse(vec.begin(),vec.end());

for(int i=m+1,j=0;i<arr.size();i++,j++)

{

arr[i] = vec[j];

}

}

thedaudgy
Published On 07-Aug-2023
86 views
0 replies
C++ Solution with all passed test cases
Interview problems

#include <bits/stdc++.h>

void reverseArray(vector<int> &arr , int m)

{

// Write your code here.

vector<int>vec;

for(int i=m+1;i<arr.size();i++)

{

vec.push_back(arr[i]);

}

reverse(vec.begin(),vec.end());

for(int i=m+1,j=0;i<arr.size();i++,j++)

{

arr[i] = vec[j];

}

}

thedaudgy
Published On 07-Aug-2023
86 views
0 replies
C++ Solution with use of Built-In function
Interview problems

#include <bits/stdc++.h>

#include <iostream>

using namespace std;

int main() {

//Write your code here

int a,b,c;

cin>>a>>b>>c;

// using built in awsome function

int k=max(a,b);

int r=max(k,c);

cout<<r<<endl;

return 0;

}

thedaudgy
Published On 07-Aug-2023
30 views
0 replies
C++ Solution with use of Built-In function
Interview problems

#include <bits/stdc++.h>

#include <iostream>

using namespace std;

int main() {

//Write your code here

int a,b,c;

cin>>a>>b>>c;

// using built in awsome function

int k=max(a,b);

int r=max(k,c);

cout<<r<<endl;

return 0;

}

thedaudgy
Published On 07-Aug-2023
30 views
0 replies