原题链接
typescript
function isStraight(nums: number[]): boolean {
nums = nums.filter(item => item); // 过滤大小王
if(nums.length !== Array.from(new Set([...nums])).length) {
return false; // 有重复 直接错误
}
return Math.max(...nums) - Math.min(...nums) < 5;
};