#Iwakk's reccurision test cases

1 messages · Page 1 of 1 (latest)

main oriole
#

testing

dreamy dockBOT
#

<@&987246399047479336> please have a look, thanks.

main oriole
#

this is a

#

program that i made

#

this code here

#

    // Method to compute the sum of the digits of a number recursively
    public int numSum(int n) {
        if (n == 0) {
            return 0;
        }
        return n % 10 + numSum(n / 10);
    }

    public int lucky7s(int n) {
        if (n == 0) {
            return 0;
        }

        int lastDigit;
        lastDigit = n % 10;

        if (lastDigit == 7) {
            return 1 + lucky7s(n / 10);
        } else {
            return lucky7s(n / 10);
        }
    }
    
    public int gobbet(String str) {
        if (str.length() < 3) {
            return 0;
        }

        char firstChar, thirdChar;

        firstChar = str.charAt(0);
        thirdChar = str.charAt(2);
        String remainingString = str.substring(1);

        if (firstChar == thirdChar) {
            return 1 + gobbet(remainingString);
        } else {
            return gobbet(remainingString);
        }
    }
}```
#

was meant to run test cases for the length of iwakk's somethign something

main oriole
#

@tepid olive

#

yo bro

#

fam

#

dog

#

dawg

#

we tryna get the mans in the crib ya fell me ayy?? ya blowing on me ting rn ma son? ya felling alr there? oh shi bruh the mans in his feeling rn ayyy?? yaa mannn the indians be making it smelly like the jelly i be whopping in math class just to take another lash ba my father

edgy iron
#

what's your question?

main oriole
#

Understandable

#

i was just tryna warm-up before my friend @tepid olive gets here

#

hes just a sloush when it comes to classic english poem righting

#

i actually took a class by the professor named "Mr.cityboyjj" from a university called york in the province in Canada called Ontario

wheat verge
#

Also please make sure it's an actual question thread where helpers can chip in, otherwise please use DMs.

main oriole
#

yes that is true