Menu
Coddy logo textTech

Split Array

Lesson 12 of 15 in Coddy's Recursion Challenges - Master The Recursive Thinking course.

challenge icon

Challenge

Medium

Write a function named isSplitable that gets an array of integers and returns true if it's possible to split the array into two arrays where the sum of both of them is the same, otherwise false.

Examples,

  • [5, 2, 3]  ->  [5] and [2, 3]
  • [2, 3]  ->  Not splitable

Try it yourself

#include <stdbool.h>

bool isSplitable(const int *arr, int size) {
    // Write code here
}

All lessons in Recursion Challenges - Master The Recursive Thinking