Home

Published

- 1 min read

metro card javascript

img of metro card javascript

The solution for this is noted below

metro card javascript

Solution

   function solution(lastNumberOfDays) {
	let result = []
	if (lastNumberOfDays === 28) {
		result.push(31)
	} else if (lastNumberOfDays === 30) {
		result.push(31)
	} else if (lastNumberOfDays === 31) {
		result.push(28, 30, 31)
	}
	return result
}

Try other methods by searching on the site. That is if this doesn’t work