Sort by

recency

|

1893 Discussions

|

  • + 0 comments

    Here is my Simple and straightforward Java solution :

    return (int) (s.chars().filter(Character::isUpperCase).count()+1);

  • + 0 comments

    Here is my easy solution in c++, you can have the explanation here : https://youtu.be/1PDDxGbmSj8

    #include <bits/stdc++.h>
    
    using namespace std;
    
    
    int main()
    {
        string s;
        cin >> s;
        int r = 1;
        for(int i = 0; i < s.size(); i++) {
            if(s[i] < 'a') r++;
        }
        cout << r;
        return 0;
    }
    
  • + 0 comments

    int camelcase(string s) { int count=1; for(int i=1;i

  • + 0 comments

    C++

    int camelcase(string s) {
        int cnt = 1;
        for (int i : s) {
            if (isupper(i)) {
                cnt++;
            }
        }
        return cnt;
    }
    
  • + 0 comments

    Python solution:

    def camelcase(s):
        cnt = 1;
        for x in s:
            if x.isupper():
                cnt = cnt + 1
        return cnt