leetcode771(java) Jewels and Stones

1人阅读 评论(0) 收藏 举报
分类:
public int numJewelsInStones(String J, String S) {
        int result = 0;
        char[] j = J.toCharArray();
        char[] s = S.toCharArray();
        for(int a=0;a<j.length;a++){
            for(int b=0;b<s.length;b++){
                if(s[b]==j[a]){
                    result++;
                }
            }
        }
        return result;
    }

查看评论

【leetcode】771. Jewels and Stones

一、题目描述 You're given strings J representing the types of stones that are jewels, and S represent...
  • xiaoquantouer
  • xiaoquantouer
  • 2018-02-05 16:33:51
  • 340

771.Jewels and Stones (leetcode)

Strings J representing the types of stones that are jewels, and S representing the stones you have. ...
  • Joker_YY
  • Joker_YY
  • 2018-01-28 20:45:08
  • 475

python--leetcode771. Jewels and Stones

You're given strings J representing the types of stones that are jewels, and S representing the st...
  • wenqiwenqi123
  • wenqiwenqi123
  • 2018-03-19 17:07:40
  • 27

[Leetcode从零开刷]771. Jewels and Stones

Jewels and Stones leetcode 题目 You’re given strings J representing the types of stones that ar...
  • legalhighhigh
  • legalhighhigh
  • 2018-02-03 10:23:38
  • 417

python实现 leetcode 771 jewels and stones

说来惭愧,别人几年前干的事情,拖到今天自己才开始自己的leetcode之路。但是开始就好吧!题目描述不再摘抄。AC率最高的一题,一个寒假都没编程的我开始竟然有些懵,参考了discuss里大神lee21...
  • weixin_38425780
  • weixin_38425780
  • 2018-03-04 17:39:26
  • 148

LeetCode 771. Jewels and Stones

You are given strings J representing the types of stones that are jewels, and S representing the sto...
  • liuchuo
  • liuchuo
  • 2018-01-29 15:25:47
  • 397

【LeetCode】771. Jewels and Stones 解题报告

【LeetCode】771. Jewels and Stones 解题报告 标签(空格分隔): LeetCode 题目地址:https://leetcode.com/problems/jewe...
  • fuxuemingzhu
  • fuxuemingzhu
  • 2018-01-28 19:51:30
  • 1004

[leeccode]771. Jewels and Stones

You're given strings J representing the types of stones that are jewels, and S representing the st...
  • kangbin825
  • kangbin825
  • 2018-02-04 16:57:12
  • 86

Jewels and Stones

https://leetcode.com/problems/jewels-and-stones/description/ 题解:给出两个字符串,返回在字符串S中包含有字符串中的J的字母的个数是多少...
  • weixin_38997311
  • weixin_38997311
  • 2018-02-05 20:40:54
  • 112
    个人资料
    等级:
    访问量: 256
    积分: 116
    排名: 122万+
    文章分类
    文章存档
    最新评论