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.
Example 1:
Input:
S = machine
Output: 1
Explanation: machine is an isogram
as no letter has appeared twice. Hence
we print 1.
Example 2:
Input:
S = geeks
Output: 0
Explanation: geeks is not an isogram
as 'e' appears twice. Hence we print 0.
Your Task:
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|
Constraints:
1 <= |s| <= 10^{3}

Difficulty: EASY
Tags: String algorithms

Data structures
Skill types: Data structures
Expected Time Complexity: O(N).
Expected Auxiliary Space: O(Number of distinct characters).

Starter code:

#User function Template for python3

class Solution:
    
    #Function to check if a string is Isogram or not.
    def isIsogram(self,s):
        #Your code here

Solutions:
class Solution:

	def isIsogram(self, s):
		k = list(s)
		for i in k:
			if k.count(i) != 1:
				return False
		return True


from collections import Counter

class Solution:

	def isIsogram(self, s):
		l = []
		p = Counter(s)
		for i in p:
			l.append(p[i])
		if max(l) >= 2:
			return False
		else:
			return True


class Solution:

	def isIsogram(self, s):
		d = {}
		x = 0
		for i in range(len(s)):
			if s[i] in d:
				d[s[i]] += 1
			else:
				d[s[i]] = 1
		for key in d:
			if d[key] > 1:
				x = d[key]
				break
		if x == 0:
			return True
		else:
			return False


class Solution:

	def isIsogram(self, s):
		x = set()
		for i in s:
			if s.count(i) > 1:
				return False
		return True


class Solution:

	def isIsogram(self, s):
		for char in s:
			if s.count(char) > 1:
				return False
		return True


class Solution:

	def isIsogram(self, s):
		return len(s) == len(set(s))


class Solution:

	def isIsogram(self, s):
		for i in range(len(s)):
			count = 0
			count = s.count(s[i])
			if count > 1:
				return False
		return True


class Solution:

	def isIsogram(self, s):
		map1 = {}
		for i in range(len(s)):
			if s[i] in map1:
				map1[s[i]] += 1
			else:
				map1[s[i]] = 1
		for (x, y) in map1.items():
			if y > 1:
				return False
		return True


class Solution:

	def isIsogram(self, s):
		d = {}
		for i in s:
			if i not in d:
				d[i] = 1
			else:
				d[i] += 1
		for i in s:
			if d[i] > 1:
				return False
		return True


class Solution:

	def isIsogram(self, s):
		a = set(s)
		if len(s) == len(a):
			return True
		else:
			return False


class Solution:

	def isIsogram(self, s):
		string = ''
		for i in s:
			if i not in string:
				string += i
		if string == s:
			return True
		else:
			return False


from collections import Counter

class Solution:

	def isIsogram(self, s):
		for char in s:
			if s.count(char) > 1:
				return False
		return True


class Solution:

	def isIsogram(self, s):
		a = ''
		for i in s:
			if i not in a:
				a = a + i
		if a == s:
			return True
		return False


class Solution:

	def isIsogram(self, s):
		d = {}
		for i in s:
			if i not in d:
				d[i] = 1
			else:
				d[i] += 1
		for (k, v) in d.items():
			if v > 1:
				return False
				break
		else:
			return True


class Solution:

	def isIsogram(self, s):
		d = {}
		for i in s:
			if i in d:
				return False
			else:
				d[i] = 1
		for (key, i) in d.items():
			if i != 1:
				return False
		return True


import collections

class Solution:

	def isIsogram(self, s):
		dict1 = collections.Counter(s)
		for i in s:
			if dict1[i] > 1:
				return False
		return True


class Solution:

	def isIsogram(self, s):
		new = list(set(list(s)))
		new = ''.join(new)
		if len(s) != len(new):
			return False
		return True


class Solution:

	def isIsogram(self, s):
		if sorted(list(set(s))) == sorted(list(s)):
			return True
		else:
			return False


class Solution:

	def isIsogram(self, s):
		str = ''
		for i in s:
			if i not in str:
				str += i
		if len(s) == len(str):
			return True
		return False


class Solution:

	def isIsogram(self, s):
		dic = {}
		for i in range(97, 123):
			dic.update({chr(i): 0})
		for i in s:
			dic[i] += 1
			if dic[i] > 1:
				return False
		return True


class Solution:

	def isIsogram(self, s):
		seen = set()
		for ch in s:
			if ch in seen:
				return False
			seen.add(ch)
		return True


class Solution:

	def isIsogram(self, s):
		freq = set()
		for i in s:
			if i in freq:
				return False
			else:
				freq.add(i)
		return True


class Solution:

	def isIsogram(self, s):
		S = ''
		for i in s:
			if i in S:
				return False
			S += i
		return True


from collections import Counter

class Solution:

	def isIsogram(self, s):
		mem = Counter(s)
		if any((mem[i] > 1 for i in set(s))):
			return False
		else:
			return True


class Solution:

	def isIsogram(self, s):
		d = {}
		for i in s:
			if i in d:
				d[i] += 1
			else:
				d[i] = 1
		arr = []
		for i in s:
			if d[i] != 1:
				arr.append(i)
		if len(arr) == 0:
			return True
		else:
			return False


class Solution:

	def isIsogram(self, s):
		st = []
		for i in range(len(s)):
			if s[i] not in st:
				st.append(s[i])
			else:
				return False
		return True


class Solution:

	def isIsogram(self, s):
		freq = {}
		for i in s:
			if i not in freq:
				freq[i] = 0
			freq[i] += 1
		for i in freq:
			if freq[i] > 1:
				return False
		return True


class Solution:

	def isIsogram(self, s):
		for i in s:
			if s.count(i) > 1:
				return False
				break
		return True


class Solution:

	def isIsogram(self, s):
		freq_s = [0] * 26
		for c in s:
			if freq_s[ord(c) - ord('a')]:
				return False
			else:
				freq_s[ord(c) - ord('a')] += 1
		return True


class Solution:

	def isIsogram(self, s):
		d = {}
		for i in s:
			d[i] = d.get(i, 0) + 1
		for i in d:
			if d[i] > 1:
				return False
		return True


class Solution:

	def isIsogram(self, s):
		s1 = list(s)
		s2 = set(s1)
		if len(s1) == len(s2):
			return True
		else:
			return False


class Solution:

	def isIsogram(self, s):
		letter = {x: 0 for x in s}
		for x in s:
			letter[x] += 1
			if letter[x] > 1:
				return False
		return True


class Solution:

	def isIsogram(self, s):
		countchar = [0] * 26
		for i in range(len(s)):
			index = ord(s[i]) - ord('a')
			countchar[index] += 1
			if countchar[index] > 1:
				return False
		return True


class Solution:

	def isIsogram(self, s):
		tracker = set()
		for i in s:
			if i not in tracker:
				tracker.add(i)
			else:
				return False
		return True


class Solution:

	def isIsogram(self, s):
		result = []
		for char in s:
			if char in result:
				return False
			else:
				result.append(char)
		return True


class Solution:

	def isIsogram(self, s):
		S = ''
		c = 0
		for i in s:
			if i in S:
				c = 1
			else:
				S += i
		if c == 1:
			return False
		else:
			return True


class Solution:

	def isIsogram(self, s):
		d = {}
		for i in s:
			if i in d:
				d[i] += 1
			else:
				d[i] = 1
		l = []
		for i in d.values():
			l.append(i)
		for i in l:
			if i != 1:
				return False
				break
		return True


class Solution:

	def isIsogram(self, s):
		mapper = {}
		for i in s:
			if i in mapper:
				return False
			else:
				mapper[i] = 1
		return True


class Solution:

	def isIsogram(self, s):
		char_count = {}
		isogram = 0
		for char in s:
			char_count[char] = char_count.get(char, 0) + 1
		for key in char_count.keys():
			if char_count[key] > 1:
				isogram += 1
		if isogram != 0:
			return False
		else:
			return True


class Solution:

	def isIsogram(self, s):
		import collections
		freqs = collections.Counter(s)
		if len(set(freqs.values())) == 1 and 1 in set(freqs.values()):
			return True
		else:
			return False


class Solution:

	def isIsogram(self, s):
		if any((s.count(letter) > 1 for letter in s)):
			return False
		return True


class Solution:

	def isIsogram(self, s):
		Isogram = set(list(s))
		if len(s) == len(Isogram):
			return True
		return False


class Solution:

	def isIsogram(self, s):
		t = list(set(s))
		m = list(s)
		if len(t) == len(m):
			return True
		return False


class Solution:

	def isIsogram(self, s):
		k = list(map(ord, s))
		l = set(k)
		if len(k) == len(l):
			return True
		else:
			return False


class Solution:

	def isIsogram(self, s):
		tmp = set(s)
		if len(s) == len(tmp):
			return True
		return False