Simple C solution
Intuition\nIdea is to find the smallest element and then find the element with which it has more difference.\n\n# Approach\n when the numsSize is below 2 , whic
# Intuition\nIdea is to find the smallest element and then find the element with which it has more difference.\n\n# Approach\n* when the `numsSize` is below 2 , which means there are no sufficient number of elements, so `return -1`\n* Initialise `minVal` to first digit `nums[0]`, `maxDiff` to `-1`\n* Iterate through the `nums` array. \n    * if a number greater than `minVal` is found then find the        difference between thise two numbers and store the value in `diff` variable.\n    * if `diff` is greater than `maxDiff` then replace the value in `maxDiff` by `diff`\n    * else if `nums[i]` is less tha n `minVal` then replace value in `minVal` with `nums[i]`\n* return `maxDiff`\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\n#include <limits.h>\n\nint maximumDifference(int* nums, int numsSize) {\n    if (numsSize < 2) return -1;\n\n    int minVal = nums[0];\n    int maxDiff = -1;\n\n    for (int i = 1; i < numsSize; i++) {\n        if (nums[i] > minVal) {\n            int diff = nums[i] - minVal;\n            if (diff > maxDiff) {\n                maxDiff = diff;\n            }\n        }\n        if (nums[i] < minVal) {\n            minVal = nums[i];\n        }\n    }\n\n    return maxDiff;\n}\n\n```
['C']