### Another Solution: Longest Palindrome Substring

class Solution(object): def __init__(self): self.lookup = {“test”} def isPalindrome(self, s, i, k): j = i + k – 1 if s[i] == s[j]: key = self.createKey(i + 1, j – 1) if key in self.lookup: #self.lookup.remove(key) return True return False def createKey(self, i, j): #return “{}:{}”.format(i,j) #return (i, j) #key = bin(i) + bin(j) #return … More Another Solution: Longest Palindrome Substring

### Codeforces Problem: Azamon Web Services: Solution in Python

Problem Given two string, find if using max one swap of characters, the first string is lexicographically smaller than the other string. Solution The logic is as follows: Create an index map of each character in the string A. Compare String A & String B, character-by-character. If characters are the same, move to the next … More Codeforces Problem: Azamon Web Services: Solution in Python

### One More Reason to Avoid Ruby Language

Ruby is type unsafe language but it goes a step further and avoids checking dynamically too. Consider this code x = :abc if x == ‘abc’ puts “Symbol and String are two different classes” else puts x.class, ‘abc’.class end # puts can print a symbol and string alike. puts x My Complaints I’m new to … More One More Reason to Avoid Ruby Language