codewars

CODE WARS

Repository to save practices of golang

MakeTheDeadfishSwim

Write a simple parser that will parse and run Deadfish.

Deadfish has 4 commands, each 1 character long:

i increments the value (initially 0)
d decrements the value
s squares the value
o outputs the value into the return array
Invalid characters should be ignored.

Parse(“iiisdoso”) == []int{8, 64}

Link: https://www.codewars.com/kata/51e0007c1f9378fa810002a9/go

Is it a palindrome?

Write function isPalindrom that checks if a given string (case insensitive) is a palindrom.

Counting Duplicates

Count the number of Duplicates
Write a function that will return the count of distinct case-insensitive alphabetic characters and numeric digits that occur more than once in the input string. The input string can be assumed to contain only alphabets (both uppercase and lowercase) and numeric digits.

Example
“abcde” -> 0 # no characters repeats more than once
“aabbcde” -> 2 # ‘a’ and ‘b’
“aabBcde” -> 2 # ‘a’ occurs twice and ‘b’ twice (b and B)
“indivisibility” -> 1 # ‘i’ occurs six times
“Indivisibilities” -> 2 # ‘i’ occurs seven times and ‘s’ occurs twice
“aA11” -> 2 # ‘a’ and ‘1’
“ABBA” -> 2 # ‘A’ and ‘B’ each occur twice

Link: https://www.codewars.com/kata/54bf1c2cd5b56cc47f0007a1/go

Visit original content creator repository
https://github.com/jonaferreira/codewars

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *