Create a function that accepts str and cases as parameters where the string is split into N distinct cases of equal length as shown:
splitNCases("Strengthened", 6) ➞ ["St", "re", "ng", "th", "en", "ed"]
splitNCases("Unscrupulous", 2) ➞ ["Unscru", "pulous" ]
splitNCases("Flavorless", 1) ➞ ["Flavorless" ]
If it's not possible to split the string as described, return ["Error"] .