7 kyu

Search for letters

1,724 of 6,669Roy Gardiner

Description:

Create a function which accepts one arbitrary string as an argument, and return a string of length 26.

The objective is to set each of the 26 characters of the output string to either '1' or '0' based on the fact whether the Nth letter of the alphabet is present in the input (independent of its case).

So if an 'a' or an 'A' appears anywhere in the input string (any number of times), set the first character of the output string to '1', otherwise to '0'. if 'b' or 'B' appears in the string, set the second character to '1', and so on for the rest of the alphabet.

For instance:

"a   **&  cZ"  =>  "10100000000000000000000001"
"aaaaaaa79345675"  =>  "10000000000000000000000000"
"&%#*"  =>  "00000000000000000000000000"
Strings
Fundamentals

More By Author:

Check out these other kata created by Roy Gardiner

Stats:

CreatedJan 19, 2014
PublishedJan 19, 2014
Warriors Trained12775
Total Skips1484
Total Code Submissions24565
Total Times Completed6669
Ruby Completions1724
JavaScript Completions2207
C# Completions408
Python Completions1936
Haskell Completions79
C Completions180
Rust Completions164
TypeScript Completions114
Java Completions79
PHP Completions23
Total Stars133
% of votes with a positive feedback rating92% of 826
Total "Very Satisfied" Votes717
Total "Somewhat Satisfied" Votes91
Total "Not Satisfied" Votes18
Ad
Contributors
  • Roy Gardiner Avatar
  • jhoffner Avatar
  • ZozoFouchtra Avatar
  • colin92 Avatar
  • aweleshetu Avatar
  • imjasonmiller Avatar
  • JohanWiltink Avatar
  • Madjosz Avatar
  • Souzooka Avatar
  • rowcased Avatar
  • user1799785 Avatar
  • FArekkusu Avatar
  • hobovsky Avatar
  • albertogcmr Avatar
  • sonukmr8910 Avatar
  • user5564395 Avatar
  • user6552504 Avatar
Ad