Sha256: 59593f0c91a66116019e13232a948423e270b2139562642837df88fe1daa52fb
Contents?: true
Size: 522 Bytes
Versions: 146
Compression:
Stored size: 522 Bytes
Contents
/** * Here is an example solution for the Isogram exercise */ component { function isIsogram( input ) { // Only look at alphabit chars var cleanedInput = input.reReplaceNoCase( '[^a-z]', '', 'all' ); var chars = {}; // Loop over characters cleanedInput .listToArray( '' ) .each( function( char ) { // And mark distinct list of them chars[ char ] = true; } ); // If the number of chars in the input is the same as the distinct list return cleanedInput.len() == chars.count(); } }
Version data entries
146 entries across 145 versions & 1 rubygems