TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

I can code that FizzBuzz function with only two tests

2 pointsby plastic_teethalmost 5 years ago

2 comments

rethabalmost 5 years ago
Or with AWK: echo 15 | awk '$1%3==0{s=s"Fizz"} $1%5==0{s=s"Buzz"} END{print s}'
评论 #23465041 未加载
brudgersalmost 5 years ago
There is no clever way to compute FizzBuzz. It is a constant.