New update is available. Click here to update.
A Remote Software Developer From Asia/India.
Thakur College of Engineering and Technology 2024
My Stats
EXP gained
5997
Level
6 (Specialist)
Community stats
Discussions
1
1
Know more
173
Total problems solved
151
Easy
20
Moderate
2
Hard
0
Ninja

Current streak:

0 days

Longest streak:

6 days

Less

More

Achievements
2
Ronin
Topics
Arrays
Sorting
Discussions
C++ Soln || Easy TO Understand
Interview problems

Time Complexity: O(N)

``````#include <bits/stdc++.h>
int largestElement(vector<int> &arr, int n) {
// Write your code here.
int maxi = INT_MIN;
for(int i=0;i<n;i++){
if(arr[i]>maxi)
maxi = arr[i];
}
return maxi;
}
``````
rapid_killer_9
Published On 02-Nov-2023
84 views
0 replies
C++ Easy To Understand Soln
Interview problems
``````vector<int> countFrequency(int n, int x, vector<int> &nums){
// Write your code here.
vector<int> ans(n);
for(int i=0;i<nums.size();i++){
ans[nums[i]-1]++;
}
return ans;
}``````
rapid_killer_9
Published On 01-Nov-2023
555 views
3 replies
Easy To understand C++ Soln
Interview problems
``````long long fact(long long x){
if(x==1) return 1;
return x*fact(x-1);
}

vector<long long> factorialNumbers(long long n) {
// Write Your Code Here
vector<long long> ans;
long long x;
for(long long i=1;i<=n;i++){
x=fact(i);
if(x>n)
return ans;
else
ans.push_back(x);
}
}``````
rapid_killer_9
Published On 29-Oct-2023
480 views
0 replies