মনে করুন s একটি স্ট্রিং যা একটি বাক্য উপস্থাপন করে। আমাদের যাচাই করতে হবে ইংরেজি বর্ণমালার প্রতিটি অক্ষর কমপক্ষে একবার ব্যবহার হয়েছে কিনা।
উদাহরণস্বরূপ, "The grumpy wizards make toxic brew, for the evil queen and Jack" হলে আউটপুট True।
সমাধানের ধাপসমূহ
- s := s-এর সব অক্ষর ছোট হাতের করুন
- প্রতিটি i ইংরেজি বর্ণমালায়,
- যদি i s-এ না থাকে, তবে
- False ফেরত দিন
- যদি i s-এ না থাকে, তবে
- True ফেরত দিন
উদাহরণ
import string
class Solution:
def solve(self, s):
s=s.lower()
for i in string.ascii_lowercase:
if i not in s:
return False
return True
s = "The grumpy wizards make toxic brew, for the evil queen and Jack"
ob = Solution()
print(ob.solve(s))ইনপুট
"The grumpy wizards make toxic brew, for the evil queen and Jack"
আউটপুট
True