当前位置:网站首页>Leetcode interview question 16.15 Abacus wonderful calculation
Leetcode interview question 16.15 Abacus wonderful calculation
2022-07-02 18:25:00 【I'm not Xiao Haiwa~~~~】

Abas magic calculation game (the game of master mind) Here's how to play .
Computers have 4 Slot , Put a ball in each slot , The color could be red (R)、 yellow (Y)、 green (G) Or blue (B). for example , Computers may have RGGB 4 Kind of ( Slot 1 In red , Slot 2、3 It's green , Slot 4 For blue ). As the user , You try to guess the color combination . For example , You might guess YRGB. If you guess the color of a slot , It's one time “ Guess right ”; If you only guess the right color, but the slot is wrong , It's one time “ A false guess ”. Be careful ,“ Guess right ” Can't count into “ A false guess ”.
Given a color combination solution And a guess guess, Write a method , Returns the number of hits and false guesses answer, among answer[0] For the number of guesses ,answer[1] The number of false guesses .
Example :
Input : solution="RGBY",guess="GGRR"
Output : [1边栏推荐
- Unity学习shader笔记[八十二]增强单通道颜色渲染的黑白处理
- NM02-独立于总线协议的NM模块调用序列图及代码解释
- Unity学习shader笔记[八十一]简单的颜色调整后处理(亮度,饱和度,对比度)
- In Linux, MySQL sets the job task to start automatically
- Design of the multi live architecture in different places of the king glory mall
- Aptos tutorial - participate in the official incentive testing network (ait2 incentive testing network)
- 面试,关于线程池的那些事
- Export Excel files using npoi
- [golang | grpc] use grpc to realize simple remote call
- Calculation of favorable comment rate
猜你喜欢

初夏,开源魔改一个带击杀音效的电蚊拍!

【愚公系列】2022年07月 Go教学课程 001-Go语言前提简介

Leetcode 面试题 16.15. 珠玑妙算

Leetcode 面试题 17.01. 不用加号的加法

Please, stop painting star! This has nothing to do with patriotism!

exness深度好文:动性系列-黄金流动性实例分析(五)
![[games101] operation 4 B é zier curve](/img/57/e7a9191b959cb1177b7bd1a439df2a.png)
[games101] operation 4 B é zier curve

Chrome officially supports MathML, which is enabled in chromium dev 105 by default

Another double non reform exam 408, will it be cold? Software College of Nanchang Aviation University

微信核酸检测预约小程序系统毕业设计毕设(1)开发概要
随机推荐
微信核酸检测预约小程序系统毕业设计毕设(5)任务书
Relax again! These fresh students can settle directly in Shanghai
Vi/vim delete: one line, one character, word, the first character of each line command
Wechat applet video sharing platform system graduation design completion (8) graduation design thesis template
Iframe nesting details
qt的内存映射
微信核酸检测预约小程序系统毕业设计毕设(3)后台功能
Use dosbox to run the assembly super detailed step "suggestions collection"
Another double non reform exam 408, will it be cold? Software College of Nanchang Aviation University
Wechat applet video sharing platform system graduation design completion (4) opening report
Leetcode 面试题 17.01. 不用加号的加法
RTE11- 中断解耦功能
In Linux, MySQL sets the job task to start automatically
Customize a loading instruction
719. Find the distance of the number pair with the smallest K
A4988 and 42 stepper motors
vi/vim 删除:一行, 一个字符, 单词, 每行第一个字符 命令
Finally detailed explanation
Freemaker+poi realizes dynamic generation and parsing of Excel files
Interview, about thread pool