Practice
Compete
Contribute
Learn
Log In
Sign Up
Uniqueness Check
Anonymous
1,111 views
Use
/*
Function hasUniqueChars2
Args - std::string
Output:: True if string has all characters which are unique
False if string has at least one repeated char.
Assumption:: string only contains (a..z), 26 chars. */
1
2
3
4
5
6
7
8
9
10
#include<iostream>
#include<string>
using namespace std;
bool hasUniqueChars2( std::string str)
{
int check = 0;
int len = str.length();
for (int i = 0; i < len; ++i)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Run
0
0
Create your playground on Tech.io
This playground was created on Tech.io, our hands-on, knowledge-sharing platform for developers.
Go to tech.io
Suggested playgrounds
std::shared_ptr cyclic references
By
Unnamed contributor
1,421
1
0
Does this work?
By
Unnamed contributor
1,530
0
0
How to build a chatbot in less than 50 lines of code
By
[CG]Maxime
3,436
22
0
Why Learn Python
By
[CG]Maxime
4,719
53
0
Join the CodinGame community on Discord to chat about puzzle contributions, challenges, streams, blog articles - all that good stuff!
JOIN US ON DISCORD
Online Participants
Keyboard Shortcuts:
?
Show / hide this help menu
×