educative.io

Change int to double

void complexMethod(int[] array) {
    int n = array.length;
    int runFor = Math.pow(-1, n) * Math.pow(n, 2);
    for (int i = 0; i < runFor; i++) {
        System.out.println("Find how complex I am ?")
    }
}

This variable runFor should be double. The product of the Math.pow operations returns double.


Course: Educative: Interactive Courses for Software Developers
Lesson: Educative: Interactive Courses for Software Developers

Hi @DavidKariuki

Thank you for the suggestion. It is great seeing our users thinking out of the box and coming up with betterment. Your feedback is much appreciated, We’ll look into it.

You’re welcome


Course: Educative: Interactive Courses for Software Developers
Lesson: Educative: Interactive Courses for Software Developers