Loading [Contrib]/a11y/accessibility-menu.js
Back
Close

Uniqueness Check

Anonymous
1,214 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. */
#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
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
codingame x discord
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