Scheme String Help -


I am trying to write a function that evaluates the number of different characters in the input string str. So for example (different "eeeiicczz") will come back 4. I need some help with my code. This is what I have.

  (define string-string (strand) (if (equal? ​​Str "") #f (if char =? (String-riff F 0) char) # T () () () () () () () () () () defines unique character (lambda (str) () (string-string- (string-string-string) 1) (string-referee Straight) () () () () ()) () () () () () () (String-length (unique-character ARR)))  

I Function:

  (if xyz), (cond ...), (read) (string-long x) (string-referee xx) (xing x) (String- Apex xy) (equal to? Xy), (four =?) (The remaining x y), (quotient xy) (max ...), (min ...) (+ xy), (- xy) (* Xy), (/ xy) (& lt; xy), (& lt; = xy), (> = xy) (and xy), (or xy), (not Xy)  

Since it is possible to convert a string to a list, do so much Will be easy and use the built-in list functions D. (Note: The following code is in the racket, because it is too much planning, I accept these tasks. If they do not check your docs for something similar)

  (defined) (Different -char str) (length (delete-duplicates (string-> list str))  

Here is a template that you can fill. Change seems to be with you in every situation. Good luck!

  (define (skins -String? Str? (# | Is the property empty string? Add a simple Boolean expression here? |) (Define (four-present? Str char) (cond [(empty string? Str) (# | if string Empty, then what character is there? | #)] [Else (see the first letter in the string #) See again that we do not call this function on other strings.))) #)])) (Defined) Do (unique characters) (cond [(empty string? Str) (# | what if you string down May include so what could be reversed? |) # []] [Else (# | if it exists in the rest of the letter string at the beginning of the string, or ignore it and recursion predecessor rest string. If not, attach the rest of the character to the result of this function on the string. #)])) (Define (different characters) (string-length (unique-character stroke)))  

Comments