dorseysen / One-Date-One-Question

this is a space for self-improvement of mine
1 stars 0 forks source link

2019-10-03:报7游戏,返回安全数。难度 ☆ #149

Open dorseysen opened 4 years ago

dorseysen commented 4 years ago

报7游戏,返回安全数。 难度 ☆ 一群人在玩游戏,人数是100,从1~100编号,并从头到尾1、2、3...7这样循环报数。报到7的那个人会消失,求劫后余生的数

dorseysen commented 4 years ago

// 2019-10-03:报7游戏,返回安全数
// 难度 ☆

// 一群人在玩游戏,人数是100,从1~100编号,并从头到尾1、2、3...7这样循环报数。报到7的那个人会消失,求劫后余生的数
const safeNums = ( arr, danger ) => arr.filter(item => item !== danger);

return safeNums($state.arr100, 7);