Tuesday, 11 February 2020

Sorting

Sorting of Array


Objective

Given an array having an integer value in its element. We have to sort the array.

Sample Input

[1, 5, 12, 3, 7, 15, 9]

Sample Output

[1, 3, 5, 7, 9, 12, 15]


Code


Here’s my solution, with embedded comments:



I hope you found this helpful.
Cheers :)

No comments:

Post a Comment

Diagonal Difference

Diagonal Difference Objective Given a square matrix, calculate the absolute difference between the sums of its diagonals. Descripti...