ARTS-第一周(2019.06.30)

每周完成一个ARTS:(Algorithm、Review、Tip、Share, ARTS)**

  • Algorithm 每周至少做一个 leetcode 的算法题-主要是为了编程训练和学习
  • Review 阅读并点评至少一篇英文技术文章-主要是为了学习英文,如果你的英文不行,你基本上无缘技术高手
  • Tip 学习至少一个技术技巧-主要是为了总结和归纳你在是常工作中所遇到的知识点
  • Share – 分享一篇有观点和思考的技术文章-主要是为了建立你的影响力,能够输出价值观

Algorithm

Algorithm url:https://leetcode.com/problems/jewels-and-stones/
You’re given strings J representing the types of stones that are jewels, and S representing the stones you have. Each character in S is a type of stone you have. You want to know how many of the stones you have are also jewels.

The letters in J are guaranteed distinct, and all characters in J and S are letters. Letters are case sensitive, so “a” is considered a different type of stone from “A”.

Example 1:

Input: J = “aA”, S = “aAAbbbb”
Output: 3

Example 2:

Input: J = “z”, S = “ZZ”
Output: 0

Note:

S and J will consist of letters and have length at most 50.
The characters in J are distinct.

My Answer:

   class Solution {
    public int numJewelsInStones(String J, String S) {
        int totalNum = 0 ;
        HashSet hs = new HashSet();

        for (char c : J.toCharArray()){
            hs.add(c);
        }

        for (char c : S.toCharArray()){
            if (hs.contains(c)){
                totalNum++;
            }
        }

        return totalNum;
    }
}

Review

ElasticSearch install
1.ELK版本必须一致
2.安装顺序如下:

  1. Elasticsearch
  2. Kibana
  3. Logstash
  4. Beats
  5. APM Server
  6. Elasticsearch Hadoop

TIPS

1.工作中复杂的事情丢给别人做,自己多学些知识
2.mysql中增加索引也会有慢查询,需要减少全索引搜索次数和回表次数,
方法有很多,可以增加虚列

SHARE

文章:MySQL 性能调优——数据库的分库分表
1.分库分表两种方式:水平和垂直拆分(一般都用水平拆分)
2.介绍了数据库分片方案和分片工具oneProxyp
3.mycat用的也挺多的

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值