Skip to content

Instantly share code, notes, and snippets.

@FarazPatankar
FarazPatankar / robin.js
Created April 16, 2019 10:19 — forked from mikeyakymenko/robin.js
Round robin, league matches schedule on javascript
let teams = [
'Tigers',
'Foofels',
'Drampamdom',
'Lakebaka'
]
const roundRobin = (teams) => {
let schedule = []
let league = teams.slice()

Letter Sequencing

In Ruby create a function that takes in a series of sequential letters, processes it, and returns a new string with the number of occurances of that letter in a row.

For instance: processString("aabbcc") should return 2a2b2c. If a letter has only one occurance, it should only add the letter itself, not 1. For instance processString("abbcc") should return a2b2c.

Letters in non sequential order should be returned as is. For instance processString("aabbccabbc") should return 2a2b2ca2bc.

Assumptions