📣 黑五价提前开抢|VIP一年通行证5折,蓝莓、Offer多多同步特惠
回复: 0
跳转到指定楼层
上一主题 下一主题
收起左侧

Hackerrank MLE OA

🔗
匿名用户-HQOJJ  2026-7-6 10:31:48 |倒序浏览

2026(4-6月) MachineLearningEng 硕士 全职@hackerrank - 网上海投 - 在线笔试  | 😐 Neutral 😐 Average | Other | 在职跳槽

注册一亩三分地论坛,查看更多干货!

您需要 登录 才可以下载或查看附件。没有帐号?注册账号

x
两道题 总共给105分钟 第一道coding题相当于考数学了 第二道sklearn train model

1.
Good Subsequences
A subsequence is formed by deleting zero or more characters from a string and concatenating the remaining characters. A subsequence is considered "good" if the frequency of each character in the subsequence is the same.
Given a string of $n$ English letters, determine how many good subsequences it contains. Since the answer can be large, compute it modulo $(10^9+7)$.
Note: An empty subsequence is not considered a good subsequence.
Example
  1. word = "abca"
复制代码
From this string, we can form 15 non-empty subsequences. The only subsequences that are not good are:
  • "aba" (character 'a' appears twice, 'b' appears once)
  • "aca" (character 'a' appears twice, 'c' appears once)
  • "abca" (character 'a' appears twice, 'b' and 'c' appear once each)
The total number of good subsequences = $15 - 3 = 12$, and the answer is $12$ modulo $(10^9+7) = 12$.
Function Description Complete the function
  1. countGoodSubsequences
复制代码
in the editor with the following parameter(s):
    1. string word
    复制代码
    : a string that consists of only lowercase Latin letters
Returns
    1. int
    复制代码
    : the number of good subsequences modulo $(10^9+7)$
Constraints
  • $1 \le \text{length of word} \le 10^5$
    1. word[i]
    复制代码
    is in the range
    1. [a-z]
    复制代码


Sample Case 0
Sample Input For Custom Testing
您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限 或 查看其他获取积分的方式
Unlock interview details and practice with AI
Popular Interview Questions from Top Companies
mple is provided in "sample_submission.csv".
Test Evaluation: The score will be automatically evaluated based on the value of the weighted F1 Score metric for the "submissions.csv" file. Get the best possible value of the metric during model development. The reviewer might dive deeper into the Jupyter notebook and the visualization to get more context.

Jupyter Notebook Context
Machine Learning Build a machine learning model that can identify the customers likely to purchase.
  • The model's performance will be evaluated on the basis of F1 score.
Task:
  • Submit the predictions on the test dataset using your optimized model. Submit a CSV file with a header row plus each of the test entries, each on its own line.
Pre-loaded Code Snippets:
# The information dataset for the training set is already loaded below
data = pd.read_csv('train.csv')
data.head()

# the testing dataset is loaded below.
test = pd.read_csv('test.csv')
test.head()

评分

参与人数 1大米 +5 收起 理由
匿名用户-M8BVB + 5 感谢分享!

查看全部评分


上一篇:plaud面试难搞啊,打了个电话就没消息了烦死了
下一篇:TT 二面
您需要登录后才可以回帖 登录 | 注册账号
隐私提醒:
  • ☑ 禁止发布广告,拉群,贴个人联系方式:找人请去🔗同学同事飞友,拉群请去🔗拉群结伴,广告请去🔗跳蚤市场,和 🔗租房广告|找室友
  • ☑ 论坛内容在发帖 30 分钟内可以编辑,过后则不能删帖。为防止被骚扰甚至人肉,不要公开留微信等联系方式,如有需求请以论坛私信方式发送。
  • ☑ 干货版块可免费使用 🔗超级匿名:面经(美国面经、中国面经、数科面经、PM面经),抖包袱(美国、中国)和录取汇报、定位选校版
  • ☑ 查阅全站 🔗各种匿名方法

本版积分规则

>
1Point3Acres.com does not represent or guarantee the truthfulness, accuracy, or reliability of any of communications posted by users.
Copyright ©2009-2026 1Point3Acres.com All rights reserved. See Terms of Service.
关注我们