### Third Greatest

Fundamentals
Arrays
Data Types

Given an array of numbers, return the third greatest number in the array.
You will always be given an array of valid numbers with at least three values.

Ex:
thirdGreatest([4,8,1,5,3]) -> 4

``````function thirdGreatest(arr){
return arr.sort( (a,b) => a - b)[arr.length-3]
}``````

### Convert Minutes to Hours and Minutes

Fundamentals
Strings
Data Types

You will be given a number of minutes. Your task is to return a string that formats the number into 'hours:minutes". Make sure you always return two intigers for the minutes section of the conversion.

Example:

minutes(90) => '1:30'

``````function minutes(num){
return num % 60 < 10 ? Math.floor(num/60) + ':' + '0' + (num % 60) : Math.floor(num/60) + ':' + (num % 60)
}``````

### NumSum

For a given number (num) add up all numbers from 0 to num.
This is similar to a factorial, but using addition.

``````function numSum(num){
var sum = 0;
for (var i = 1; num >= i; i++) {
sum += i
}
return sum
};``````

### Longest Word

Find the longest word in a given string.
Assume all strings will contain only letters and spaces.

``````function longestString(str){
return str.split(' ').sort(function(a,b) {
return b.length - a.length
})[0]
}``````