Sort by

recency

|

1896 Discussions

|

  • + 0 comments

    def camelcase(s):

        # Write your code here
    count = 1
    for i in s:
        if i.isupper():
            count+=1
    return count
    
  • + 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

    RUST:

    fn camelcase(s: &str) ->i32 {
        s.chars().fold(1, |acc, l| if l.is_ascii_uppercase() {acc +1} else {acc})
    }
    
  • + 0 comments

    Heres my simple Python solution!

    def camelcase(s):
        return len([letter for letter in s if letter.isupper()]) + 1
    
  • + 0 comments

    Here is my Simple and straightforward Java solution :

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