当前位置: 首页 > news >正文

day3打印机错误

题目:

In a factory a printer prints labels for boxes. For one kind of boxes the printer has to use colors which, for the sake of simplicity, are named with letters from a to m.

The colors used by the printer are recorded in a control string. For example a "good" control string would be aaabbbbhaijjjm meaning that the printer used three times color a, four times color b, one time color h then one time color a...

Sometimes there are problems: lack of colors, technical malfunction and a "bad" control string is produced e.g. aaaxbbbbyyhwawiwjjjwwm with letters not from a to m.

You have to write a function printer_error which given a string will return the error rate of the printer as a string representing a rational whose numerator is the number of errors and the denominator the length of the control string. Don't reduce this fraction to a simpler expression.

The string has a length greater or equal to one and contains only letters from ato z.

Examples:
s="aaabbbbhaijjjm"
printer_error(s) => "0/14"

s="aaaxbbbbyyhwawiwjjjwwm"
printer_error(s) => "8/22"

我的答案:

正确答案:

http://www.jsqmd.com/news/446005/

相关文章:

  • 2026年深聊金红石型钛白粉色母,推荐靠谱品牌有哪些 - 工业品牌热点
  • 大厂AI遭维权揭秘:扒代码的“糙快猛”正被开源协议反噬
  • 2026年目前可靠的表冷器源头厂家怎么找,卡式风机盘管/表冷器/卧式暗装风机盘管/直膨式空调机组,表冷器源头厂家排行榜 - 品牌推荐师
  • 寻求杭州性价比高的医疗洁净室工程公司,收费标准是啥? - mypinpai
  • 2026螺旋焊管机组价格大揭秘,知名生产商性价比对比 - 工业品牌热点
  • 2026年浙江净化工程施工报价,靠谱的医疗净化工程大型公司排名 - mypinpai
  • 2026 年企业知识库与智能 BI 核心部署厂商推荐 (3 月更新):Deepseek 知识库、企业智能 BI 本地私有化部署全品类覆盖 - 品牌2026
  • GitHub Actions CI/CD:自动化构建与测试DAMOYOLO-S模型仓库
  • Git版本控制AI模型:管理Lingbot-Depth-Pretrain-ViTL-14实验代码与配置的最佳实践
  • 强烈安利!自考必备的AI论文软件 —— 千笔写作工具
  • 靠谱的减速机油封品牌推荐,绍鼎密封排第几? - 工业品网
  • 分析2026年料位计性价比品牌,靠谱之选别错过 - myqiye
  • Qwen-Image-2512-Pixel-Art-LoRA实战教程:用‘Pixel Art‘触发词精准控制风格输出
  • 分析南昌靠谱的梅岭民宿,品牌口碑好且费用合理的有哪些? - 工业推荐榜
  • CogVideoX-2b快速体验:10分钟内完成首次视频生成操作
  • Qwen3-ASR-1.7B部署案例:中小企业低成本搭建私有语音转写服务平台
  • 2026 年企业知识管理与 BI 部署实力厂家精选:AI 知识库部署厂商、BI 本地私有化部署方案商、Deepseek 服务商全涵盖 - 品牌2026
  • RexUniNLU企业应用:保险理赔文本中事故原因+责任方+金额实体抽取
  • 保姆级教程:OFA图像语义蕴含模型快速体验,支持中英文,开箱即用
  • mPLUG-Owl3-2B模型在STM32嵌入式系统的轻量化部署
  • AI读脸术优化技巧:提升推理速度与系统稳定性
  • 细聊2026年上海阳台封窗厂,哪家性价比高? - 工业品网
  • Qwen-Image-2512-Pixel-Art-LoRA像素艺术生成器:Gradio进度条与剩余时间预估原理
  • Windows所有系统自带.NET Framework版本win7,win10,win11预装.NET版本
  • 军工科研平台如何用Vue3实现实验数据文件夹的加密层级结构续传?
  • 2026 年 Deepseek 与企业 BI 部署核心厂商推荐:知识库私有化部署服务商、企业智能 BI 本地部署厂商、方案商一站式覆盖 - 品牌2026
  • 帝国cms全站域名更换说明EmpireCMS
  • 2026企业智能BI私有化部署厂商指南:专业BI工具部署方案商与BI本地部署服务商精选 - 品牌2026
  • 帝国cms后台登录认证码和验证码的区别EmpireCMS
  • 2026年四川门窗品牌哪家性价比高,博雅敏格门窗市场口碑与隔音效果揭秘 - 工业品网