dde272c4b8
i18n - Build Validation / Validate i18n Builds (24) (push) Has been cancelled
CI - Node.js / Lint (24) (push) Has been cancelled
CI - Node.js / Build (24) (push) Has been cancelled
CI - Node.js / Test (24) (push) Has been cancelled
CI - Node.js / Test - Upcoming Changes (24) (push) Has been cancelled
CI - Node.js / Test - i18n (italian, 24) (push) Has been cancelled
CI - Node.js / Test - i18n (portuguese, 24) (push) Has been cancelled
CD - Docker - GHCR Images / Build and Push Images (push) Has been cancelled
1.7 KiB
1.7 KiB
id, title, challengeType, dashedName
| id | title | challengeType | dashedName |
|---|---|---|---|
| 68af0687ef34c76c28ffa547 | Challenge 30: Unique Characters | 29 | challenge-30 |
--description--
Given a string, determine if all the characters in the string are unique.
- Uppercase and lowercase letters should be considered different characters.
--hints--
all_unique("abc") should return True.
({test: () => { runPython(`
from unittest import TestCase
TestCase().assertIs(all_unique("abc"), True)`)
}})
all_unique("aA") should return True.
({test: () => { runPython(`
from unittest import TestCase
TestCase().assertIs(all_unique("aA"), True)`)
}})
all_unique("QwErTy123!@") should return True.
({test: () => { runPython(`
from unittest import TestCase
TestCase().assertIs(all_unique("QwErTy123!@"), True)`)
}})
all_unique("~!@#$%^&*()_+") should return True.
({test: () => { runPython(`
from unittest import TestCase
TestCase().assertIs(all_unique("~!@#$%^&*()_+"), True)`)
}})
all_unique("hello") should return False.
({test: () => { runPython(`
from unittest import TestCase
TestCase().assertIs(all_unique("hello"), False)`)
}})
all_unique("freeCodeCamp") should return False.
({test: () => { runPython(`
from unittest import TestCase
TestCase().assertIs(all_unique("freeCodeCamp"), False)`)
}})
all_unique("!@#*$%^&*()aA") should return False.
({test: () => { runPython(`
from unittest import TestCase
TestCase().assertIs(all_unique("!@#*$%^&*()aA"), False)`)
}})
--seed--
--seed-contents--
def all_unique(s):
return s
--solutions--
def all_unique(s):
seen = set()
for ch in s:
if ch in seen:
return False
seen.add(ch)
return True