Skip to content

Instantly share code, notes, and snippets.

View 4ver's full-sized avatar
💭
thinking

Donal Linehan 4ver

💭
thinking
View GitHub Profile
{
"id": "AE9AE9FA-EE32-44BE-B8EC-A284EED66B57",
"name": "Tour '24",
"competitions": [
{
"id": "A73BBD4E-ED90-4552-BADE-4715BAE822DE",
"name": "Quinta da Ria",
"date": "2024-10-03T00:00:00Z",
"dayNumber": 1,
"courseId": "ED3EB3BB-AD10-4D3A-9CDD-7625A3459C6F",
/**
* @param {number[]} ratings
* @return {number}
*/
var candy = function(ratings) {
const isHigherValues = ratings.map((rating, index) => {
return rating > (ratings[index - 1] || 10000000) || rating > (ratings[index + 1] || 10000000)
})
const isHigherGroups = isHigherValues.reduce((prev, isHigher) => {