Update appNew update is available. Click here to update.
About
Panjab University Swami Sarvanand Giri Regional Centre 2024
My Stats
EXP gained
yellow-spark
4071
Level
5 (Champion)
Community stats
Discussions
0
Upvotes
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 %
92
Total problems solved
88
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:

15 days

Less

More

Achievements
1
Ronin
Guided path
Oops in C++
Discussions
Easy Cpp Approach
Interview problems

#include <bits/stdc++.h> 

string convertString(string str) 

{

 

  int i=0;

  str[0]=toupper(str[0]); // to capitalize first letter in string

  while(i<str.size()){

          if (str[i] == ' ') {

            str[i + 1] = toupper(str[i + 1]);                          // to capitalize the letter after space in string

          }

          i++;

        }

    return str;

}

profile
himanshu095
Published On 06-Nov-2023
47 views
0 replies
1 upvotes
Better C++ Solution
Interview problems

void nLetterTriangle(int n) {

    for(int i=0 ; i < n ;i++){

         char x = 'A';

 

        for(int j=n;j>i;j--){

            cout << x++ << " ";

        }

 

       

 

        cout << endl;

    }

}

profile
himanshu095
Published On 30-Oct-2023
22 views
0 replies
0 upvotes
Fast and improved approach
Interview problems

void nBinaryTriangle(int n) {

     for(int i=0 ; i < n ;i++){

 

        for(int j=0;j<=i;j++){

            cout << ((i+j)%2==0) << " ";

        }

 

       

 

        cout << endl;

    }

 

}

profile
himanshu095
Published On 30-Oct-2023
42 views
0 replies
0 upvotes