简体   繁体   English

专家:根据限制(最小x最大)预测数字键盘中下一个键的算法

[英]Expert: algorithm to predict next key in a numeric keyboard based on limits (min x max)

I'm trying to make an algorithm that calculates what keys can be pressed in a numeric keyboard, based on limits (min and max values) predetermined. 我正在尝试创建一种算法,该算法基于预定的限制(最小和最大值)来计算可以在数字键盘中按下的键。 So I can hide those keys that are "unavailable". 因此,我可以隐藏那些“不可用”的键。

Let's supose the value will be from 89 to 120. So what are the "first" keys available? 假设该值从89到120。那么“第一”键可用吗? And "second" keys, based on first one ? 以及基于第一个的“第二个”键? And so on... 等等...

Any tip (or link) will be very welcome. 任何提示(或链接)将非常受欢迎。

您可以将trie数据结构用于数十,数百,数千。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM