2024年Go最全【笔试记录】2020(3),2024年最新一个三非渣本的Golang校招秋招之路

img
img
img

既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,涵盖了95%以上Go语言开发知识点,真正体系化!

由于文件比较多,这里只是将部分目录截图出来,全套包含大厂面经、学习笔记、源码讲义、实战项目、大纲路线、讲解视频,并且后续会持续更新

如果你需要这些资料,可以戳这里获取

#include <iostream>
#include <stdio.h>
#include <string.h>
#include <queue>
#include <algorithm>
#include <vector>
#include <iomanip>
#include "limits.h"
#include "math.h"
using namespace std;

int main(int argc, const char \* argv[]) {
    int n, k;
    cin >> n >> k;
    vector<int> nums(n);
    int val;
    for(int i=0; i<n; i++){
        cin >> val;
        nums[i] = val;
    }
    for(int i=0; i<=k-2; i++){
        cout << nums[i] << " ";
    }
    for(int i=k; i<n; i++){
        cout << nums[i] << " ";
    }
    cout << endl;
    return 0;
}

2、字典序第k小的子串:k=[1,5]

题目

在这里插入图片描述

代码

由于k的特殊性:k=[1,5],那答案字符串的长度也不会超过k,只要把长度为k以内的所有子串抠出来排个序就可以了。用set存储会自动排序。

#include <iostream>
#include <stdio.h>
#include <string.h>
#include <queue>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <set>
#include "limits.h"
#include "math.h"
using namespace std;

int main(int argc, const char \* argv[]) {
    string str;
    int k;
    cin >> str >> k;
    
    set<string> s; //自动升序排序
    for(int i=0; i<str.length(); i++){
        //以i开头的长度不超过k的子串
        string substr = "";
        for(int j=i; j<(i+k); j++){
            if( j >= str.length() ){
                continue;
            }
            substr += str[j];
            if( s.find(substr)==s.end() ){
                 s.insert(substr);
            }
        }
    }
    set<string>::iterator iter = s.begin();
// for(; iter!=s.end(); iter++){
// cout << \*iter << endl;
// }
    for(int i=2; i<=k; i++){
        iter++;
    }
    cout << \*iter << endl;
    return 0;
}

3、数位和最大

题目

在这里插入图片描述

思路

  • ac代码。思路是尽量让9安排在个位,并可以计算出另一个数的个位数。这两个的总和就是个位的位数和。
  • 但其实可以简单思考,将x位数拆分成由x-1个9组成的数a,以及n-a。两种代码都记录一下。
#include <iostream>
#include <stdio.h>
#include <string.h>
#include <queue>
#include <algorithm>
#include <vector>
#include <iomanip>
#include "limits.h"
#include "math.h"
using namespace std;

int main(int argc, const char \* argv[]) {
    //将数字n拆成两数之和,求怎么拆,使得两数的数位和最大。输出这个数位和。
    int t;
    cin >> t;
    while( t-- ){
        long long n;
        cin >> n; //n的取值范围[1, 10^12] 这也太大了...暴力怕是不行吧
        //思路:尽量让9安排在个位
        long long sum = 0;
        while( n > 0 ){
            //n只有个位数时
            if( n <= 9){
                sum += n;
                n /= 10;
                continue;
            }
            //从个位数取9,并可以计算出另一个数的个位数。这两个的总和就是个位的位数和。
            if( n%10==9 ){//个位有9,另一位就给0
                sum += 9;
                n = n/10;


![img](https://img-blog.csdnimg.cn/img_convert/3bc512cd6b152f4387691cd354ce9e9f.png)
![img](https://img-blog.csdnimg.cn/img_convert/ef61d247c753e9a90f71155ffbc44faa.png)

**网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。**

**[需要这份系统化的资料的朋友,可以添加戳这里获取](https://bbs.csdn.net/topics/618658159)**


**一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!**

化的资料的朋友,可以添加戳这里获取](https://bbs.csdn.net/topics/618658159)**


**一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!**

  • 4
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值