Ordinary Cardinals
排序可以根据任意的比较标准有意义地进行,只要这些标准满足总排序关系的数学要求。为了弄懂这个概念,让我们定义一个正整数的古怪排序关系:对于任意两个整数,不管它们的大小和其他位数如何,都认为包含数字 9 的次数多的那个更大。
例如 99> 123456789> 1010
在这种排序中。如果两个整数包含数字 9 的次数相同,则比较到下一个较小的数字 8,依此类推,直到发现第一个可区分的数字。如果两个整数包含从 9 到 0 的每一位数的次数相同,那么普通的整数顺序比较就能确定它们的相互顺序。
您的目标是根据这一规则对给定的整数序列进行升序排序。让我们看看[111, 19, 919, 1199, 911, 999]
输入的其他示例。
输入: 列表 (List)的整数 (int).
输出: 列表 (List)的整数 (int).
举例说明:
assert sort_digit_count([99, 123456789,...
CheckiO Extensions allow you to use local files to solve missions. More info in a blog post.
In order to install CheckiO client you'll need installed Python (version at least 3.8)
Install CheckiO Client first:
pip3 install checkio_client
Configure your tool
checkio --domain=py config --key=
Sync solutions into your local folder
checkio sync
(in beta testing) Launch local server so your browser can use it and sync solution between local file end extension on the fly. (doesn't work for safari)
checkio serv -d
Alternatevly, you can install Chrome extension or FF addon
checkio install-plugin
checkio install-plugin --ff
checkio install-plugin --chromium
Read more here about other functionality that the checkio client provides. Feel free to submit an issue in case of any difficulties.
Welcome to Pair Programming! Engage in real-time collaboration on coding projects by starting a session and sharing the provided unique URL with friends or colleagues. This feature is perfect for joint project development, debugging, or learning new skills together. Simply click 'Start Session' to begin your collaborative coding journey!
You are trying to join a pair programming session that has not started yet.
Please wait for the session creator to join.
It looks like the creator of the pair programming session closed the editor window.
It might happen accidentally, so that you can wait for reconnection.