Skip to content

Instantly share code, notes, and snippets.

Avatar
:electron:
Thinking

Videh Raj Nema vrn25

:electron:
Thinking
View GitHub Profile
View IEEE_codebuddy_week1.cpp
// Problem for week 1 codebuddy IEEE: https://www.interviewbit.com/problems/largest-number/
bool comp(string a, string b){
string f1 = a+b;
string f2 = b+a;
return f1>f2?1:0;
}
string Solution::largestNumber(const vector<int> &A) {
if(!accumulate(A.begin(),A.end(),0))
return "0";
View Web_club_codebuddy_week1.cpp
// Problem for week 1 codebuddy web club: https://www.interviewbit.com/problems/max-distance/
int Solution::maximumGap(const vector<int> &A) {
vector<pair<int,int>>v;
int n = A.size();
for(int i=0;i<n;i++){
v.push_back(make_pair(A[i],i));
}
sort(v.begin(),v.end());
int largest, max_diff;
largest = v[n-1].second;
You can’t perform that action at this time.