注册一亩三分地论坛,查看更多干货!
您需要 登录 才可以下载或查看附件。没有帐号?注册账号 
x
本帖最后由 匿名 于 2024-8-6 21:39 编辑
第一题 Frequency Sort
第二题 Maximum Distinct
这两道题之前都有帖子说过
第三题 Binary Circuit, 有一些 test case 没过,有大佬知道怎么做吗
An engineer is working to build an integrated binary circuit that takes input a binary string s. A binary string consisting of only 0s and 1s can be segregated by moving all the 1s towards the end of the string. For example, nd characters at a cost of 2. The string becomes "011100".
• Now, we move each one to the end i.e. moving 2 places at a cost of 3 each.
The total cost of segregation is 2 + 2 + 3 * 3 = 13. Hence the answer is 13. |