Please enter your email address or userHandle.
Given a string S of lowercase alphabets, check if it is isogram or not. An Isogram is a string in which no letter occurs more than once.
S = machine
Explanation: machine is an isogram
as no letter has appeared twice. Hence
we print 1.
S = geeks
Explanation: geeks is not an isogram
as 'e' appears twice. Hence we print 0.
This is a function problem. You only need to complete the function isIsogram() that takes a string as a parameter and returns either true or false.
Expected Time Complexity: O(N).
Expected Auxiliary Space: O(Number of distinct characters).
Note: N = |S|
1 <= |s| <= 103
We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?
Login to access your submissions.
Please choose 'ReadOnlyMode' if you needn't to 'Edit' the problem e.g. viewing OJ's solution, TestCase Files (TCFs), TimeLimit etc.