Ad
  • Custom User Avatar
    1. Your edge case when n = 0 is incorrect - the description does not mention that you should return NULL in this case. In fact you should return the empty string (why?)
    2. Your malloc()ed buffer does not account for the number of times n the string is repeated so it is often too short to contain the result
    3. A malloc()ed buffer contains garbage values by default so you need to initialize it properly before performing string operations on it such as strcat()
  • Custom User Avatar

    The heck is a static int in javascript?

  • Custom User Avatar

    The description "forgets" to mention that you need to return a freeable array.

    Yup, you read it right: Dynamically. Allocated. Array. Of. Size. Three.

  • Custom User Avatar

    The tests are fine, your code is not. Check how you validate the input values.