当前位置:网站首页>iFLYTEK Written Exam Questions Review
iFLYTEK Written Exam Questions Review
2022-08-09 02:40:00 【Strawberry Shake Shake-】
Question 1: Given a string with some words separated by an indeterminate number of spaces, count the number of words containing the character e;
This is relatively simple and will not be solved;
The second question, given four points, calculate the corresponding convex quadrilateral area, the point is the given structure;
I didn't write it down: I can't make this basic test math formula if I don't know it, and it has no reference value, so I won't review it;
The third question, given a string, find the number of iflytek in the subsequence of the string
This is also not written, g, the backtracking template is not written correctly!!!
backtracking(str, i + 1); not backtracking(startIndex + 1);
Violent backtracking:
#include using namespace std;string target = "iflytek";string path;int res = 0;bool isPath(string& path) {for (int i = 0; i < path. size(); ++i) {if (path[i] != target[i]) return false;}return true;}void backtracking(const string& str, int startIndex) {if (!isPath(path)) return;if (path == target) {res++;return;}for (int i = startIndex; i < str.size(); ++i) {path.push_back(str[i]);backtracking(str, i + 1);path.pop_back();}}int findiflytek(string& str) {backtracking(str, 0);return res;}int main() {string str = "iflytekiflytek";cout << findiflytek(str) << endl;return 0;}
Dynamic programming solution: to see!
边栏推荐
- ZCMU--5115: Buying Keys(C语言)
- php过滤特殊字符(仅保留中文、字母、数字、下划线)
- 为什么应用程序依赖关系映射对于云迁移至关重要
- gpio子系统和pinctrl子系统(上)
- Likou Brush Question Record--Common Functions
- MT4 / MQ4L entry to the master of EA tutorial lesson two (2) - - MQL language commonly used function account information commonly used functions
- Electromagnetic radiation safety standards and detection methods
- 【Untitled】
- JS 将对象拆开拼接成 URL
- Jenkins配置钉钉通知
猜你喜欢
随机推荐
C#计算SHA1加密和base64编码
LintCode 283. 三数之中的最大值
点击div内部默认文本被选中
《独行月球》:独孤月的两次选择,让一个“中间人”成为大英雄
YOLOV1详解——Pytorch版
Tricore架构上的调试案例
xml引配置文件
微信公众号跳转小程序 wx-open-launch-weapp (最全指南及坑)
1160. 拼写单词
带你做接口测试从零到第一条用例 总结
Open3D 随机采样
【izpack】使用izpack为你的程序提供安装程序封装
<爆>2022中文版-《海外博士申请指南-材料准备、时间线、套磁、面试及录取》免费分享
【HNUMSC】C language second lecture
腾讯地图获取定位
SQLite切换日志模式优化
Open3D 点云曲率计算
最近看到很多人想自学或者报班但是不清楚如何选择,我今天就和大家说说
ROS2错误:不支持OpenGL 1.5 GLRenderSystem:: ci initialiseContext在C: \ \ ws \构建……
2022 Eye Health Brand Franchise Exhibition, Beijing Vision Care Exhibition, China Ophthalmology Technology Summit