Ad
  • Default User Avatar

    i agree, i really dont know what to do

  • Custom User Avatar

    Brute-force approach would not work as there is another mathematical approach in O(1) complexity

  • Custom User Avatar

    I recommend you go watch a few videos on youtube to better understand this.

    Cool, thanks.

    In the case of the question, the Class Ball(Object) means that the class Ball inherits the properties of the Class Object

    Yep. I suppose you're looking at the Python version. You might want to look into Python, and perhaps reference the version(s) that were relevant around the time this kata was created.


    FWIW, there was a time (at the time this kata was created) when class ClassName(object): was the "best practices" way to create classes in Python.... but I'm sure you knew that.

  • Custom User Avatar

    Hello, so an important concept in Object-Oriented Programming is INHERITANCE

    So for example lets say you have a class Animal.
    Now you create a class Dog(Animal)
    any methods(functions) and parameters that were inside an Animal class is now also used by your Dog Class.

    In the case of the question, the Class Ball(Object) means that the class Ball inherits the properties of the Class Object

    This allows you to reuuse code from one class in a different class without needing to redefine the same methods and parameters.

    I recommend you go watch a few videos on youtube to better understand this. Personally, I think that learning Java will help you understand Object-Oriented-Programming better.

  • Custom User Avatar

    In the recursive call.

  • Custom User Avatar

    Not an issue. You're not returning anything.