注册一亩三分地论坛,查看更多干货!
您需要 登录 才可以下载或查看附件。没有帐号?注册账号 
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.
ExampleFrom 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 functionin the editor with the following parameter(s):
- : a string that consists of only lowercase Latin letters
Returns
- : the number of good subsequences modulo $(10^9+7)$
Constraints
- $1 \le \text{length of word} \le 10^5$
- is in the range
Sample Case 0
Sample Input For Custom Testing
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()
上一篇:plaud面试难搞啊,打了个电话就没消息了烦死了 下一篇:TT 二面
|