使用bitmap思想解决字符串包含问题
来源:互联网 发布:潮流相机软件 编辑:程序博客网 时间:2024/06/14 06:07
public static void func(){ String s1="abxyz"; String s2="abc"; int dic=0; int i=0; for(i=0;i<s1.length();i++){ dic|=1<<(s1.charAt(i)-'a'); } for(i=0;i<s2.length();i++){ if(dic!=(dic|(1<<(s2.charAt(i)-'a'))))break; } if(i==s2.length())System.out.println("包含"); else System.out.println("不包含"); System.out.println(Integer.toBinaryString(dic)) ;//可以直接打印出二进制查看效果}
- 使用bitmap思想解决字符串包含问题
- 如何解决json字符串中包含制表符的问题
- android中使用SoftRefrence解决Bitmap过大内存溢出问题
- android中使用SoftRefrence解决Bitmap过大内存溢出问题
- 字符串包含问题
- 字符串移位包含问题
- 字符串的包含问题
- 字符串是否包含问题
- 字符串包含问题
- 字符串包含问题
- 字符串移位包含问题
- 字符串包含问题
- 字符串移位包含问题
- 字符串移位包含问题
- 字符串包含问题
- 字符串移位包含问题
- 字符串移位包含问题
- 字符串包含问题
- dom4j
- jquery 如何获得 html:text的值
- OpenCV实现PCA算法----输出异常
- 详解僵尸状态(EXIT_ZOMBLE)
- [uva] 10310 Dog and Gopher
- 使用bitmap思想解决字符串包含问题
- 千兆网口 Freescale ETSEC + Marvell 88E1111 uboot Linux 驱动分析 一
- gdb提示“you can't do that without a process to debug"解决方法
- 树莓派(raspberry pi) 系统在SD卡上安装Linux
- [uva] 10180 Rope Crisis in Ropeland!
- 笔试题总结
- 幸福慢加载---总结步步来
- 千兆网口 Freescale ETSEC + Marvell 88E1111 uboot Linux 驱动分析 二
- 鼠标没坏,左右键上下衔接不好