zoukankan      html  css  js  c++  java
  • 2:数组和字符串2

    1:Determine if all characters of a string are unique

      bool isUnique(string input)

      {

        bitset<256> hashMap;

        for(int i = 0; i < input.length(); i++)

        {

          if(hashMap[(int)input[i])

          {

              return false;

          }

          hashMap[(int)input[i]] = 1;

        }

        return true;

      }

    2:Given two strings,determine if they are permutations of each other.

      

    作者:长风 Email:844064492@qq.com QQ群:607717453 Git:https://github.com/zhaohu19910409Dz 开源项目:https://github.com/OriginMEK/MEK 本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利. 感谢您的阅读。如果觉得有用的就请各位大神高抬贵手“推荐一下”吧!你的精神支持是博主强大的写作动力。 如果觉得我的博客有意思,欢迎点击首页左上角的“+加关注”按钮关注我!
  • 相关阅读:
    单例模式的三种写法
    ASP.NET如何下载大文件
    字符串是引用类型
    SQL 事务隔离级别
    Sql Server 锁
    设非主键为聚集索引
    C#如何使用SqlCacheDependency
    简易系统后台架构
    matlab cross 3*1 向量叉乘
    Matlab求齐次方程的解
  • 原文地址:https://www.cnblogs.com/zhaohu/p/8531350.html
Copyright © 2011-2022 走看看