Back to School '16: Harambe

View as PDF

Submit solution

Points: 3 (partial)
Time limit: 2.0s
Memory limit: 256M

Author:
Problem type

One bright morning, d's English teacher needed help marking some essays. Naturally, d went out of his way to help him. When d gets the papers, he notices that the essays are riddled with improper capitalization everywhere.

Wanting to help his classmates (but not having enough time to properly fix their errors), d decides to convert the entire essay into either lowercase or uppercase text. He wants to do the least work possible, so he will convert an essay to lowercase if it already has more lowercase characters than uppercase, and vice-versa. If a tie occurs, he will leave the essay as it is.

Having a lot of essays to fix, d asks you to write a program to help him!

Input Specification

The input will consist of one line, containing one essay. The essay will have spaces and alphanumeric characters only. It is guaranteed that there are no more than 1000 characters in the essay.

Output Specification

Output the modified essay, according to the rules above.

Sample Input

mITOCHONDRIA iS tHE pOWERHOUSE oF tHE cELL

Sample Output

MITOCHONDRIA IS THE POWERHOUSE OF THE CELL

Comments


  • 0
    Hockeynet27  commented on Dec. 4, 2019, 10:55 a.m.

    Why is case 9 WA for my code


    • 2
      hxxr  commented on Dec. 5, 2019, 12:11 a.m.

      What happens if there are the same amount of uppercase and lowercase letters?


      • 0
        Xenosi  commented on Dec. 5, 2019, 5:33 p.m.

        If a tie occurs, he will leave the essay as it is. It was also replied to a comment below.


  • -3
    edgELord  commented on Nov. 1, 2018, 1:01 a.m.

    all you do is if there are more uppercase letters then make it uppercase if there are more lowercase letters then make it lowercase ez


  • 0
    Ninjaclasher  commented on April 16, 2017, 4:49 p.m. edited

    I'm pretty sure I solved this problem, however it keeps saying WA. Does anyone mind checking my code and seeing if I missed something really small, because I've spent 2 hours and I have no clue what's wrong. My code is in C++14. Thanks.

    Edit: nevermind, looks like I was printing a null character at the end of my output.


  • -3
    issamzar  commented on March 10, 2017, 3:11 p.m.

    What if the number of maj = numberof min ? please Help!


    • 0
      Iamhussam  commented on March 11, 2017, 8:51 a.m.

      If a tie occurs, he will leave the essay as it is.


  • 5
    issamzar  commented on March 8, 2017, 2:59 p.m.

    Harambe RIP :(


  • -23
    GaGrolem  commented on Nov. 14, 2016, 1:02 a.m.

    This comment is hidden due to too much negative feedback. Click here to view it.


  • -2
    Paradox  commented on Sept. 16, 2016, 7:00 p.m.

    could the essay contain numbers? like: u wot m8


    • -10
      Kirito  commented on Sept. 16, 2016, 7:16 p.m. edited

      This comment is hidden due to too much negative feedback. Click here to view it.


      • -8
        Paradox  commented on Sept. 16, 2016, 8:00 p.m.

        This comment is hidden due to too much negative feedback. Click here to view it.