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

Version Path
trackler-2.2.1.159 tracks/cfml/exercises/isogram/Solution.cfc
trackler-2.2.1.158 tracks/cfml/exercises/isogram/Solution.cfc
trackler-2.2.1.157 tracks/cfml/exercises/isogram/Solution.cfc
trackler-2.2.1.156 tracks/cfml/exercises/isogram/Solution.cfc
trackler-2.2.1.155 tracks/cfml/exercises/isogram/Solution.cfc
trackler-2.2.1.154 tracks/cfml/exercises/isogram/Solution.cfc
trackler-2.2.1.153 tracks/cfml/exercises/isogram/Solution.cfc
trackler-2.2.1.152 tracks/cfml/exercises/isogram/Solution.cfc
trackler-2.2.1.151 tracks/cfml/exercises/isogram/Solution.cfc
trackler-2.2.1.150 tracks/cfml/exercises/isogram/Solution.cfc
trackler-2.2.1.149 tracks/cfml/exercises/isogram/Solution.cfc
trackler-2.2.1.148 tracks/cfml/exercises/isogram/Solution.cfc
trackler-2.2.1.147 tracks/cfml/exercises/isogram/Solution.cfc
trackler-2.2.1.146 tracks/cfml/exercises/isogram/Solution.cfc
trackler-2.2.1.145 tracks/cfml/exercises/isogram/Solution.cfc
trackler-2.2.1.144 tracks/cfml/exercises/isogram/Solution.cfc
trackler-2.2.1.143 tracks/cfml/exercises/isogram/Solution.cfc
trackler-2.2.1.142 tracks/cfml/exercises/isogram/Solution.cfc
trackler-2.2.1.141 tracks/cfml/exercises/isogram/Solution.cfc
trackler-2.2.1.140 tracks/cfml/exercises/isogram/Solution.cfc